From patchwork Wed Jan 27 10:11:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byongho Lee X-Patchwork-Id: 8132091 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 208FF9F818 for ; Wed, 27 Jan 2016 10:12:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4FF79202E6 for ; Wed, 27 Jan 2016 10:12:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 208782026D for ; Wed, 27 Jan 2016 10:12:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932257AbcA0KM0 (ORCPT ); Wed, 27 Jan 2016 05:12:26 -0500 Received: from mail-pf0-f169.google.com ([209.85.192.169]:33894 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932139AbcA0KMB (ORCPT ); Wed, 27 Jan 2016 05:12:01 -0500 Received: by mail-pf0-f169.google.com with SMTP id q63so2592049pfb.1 for ; Wed, 27 Jan 2016 02:12:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=krxRJ1NgiX0wYZj+L6Itj31eMQtDDs2tUu0uOQQxSIc=; b=qGLmUD+iu3Ow/75V6GIu4xcd28eHgULdzqEapGNB1EW2+BrR9kCUjc30AoOgAB33Y6 LFzZlBpEwkRj7r4l68vZY1vS778ChfOAIKp3QAhq9nFxBpjJPl9str6uHXIBahPbPd7D IfRLX1A40UAOh/AeIRrJ7vHhWGcXyVMGkaCG8OOVRVTEGrbb6VhiVyT4uRAs1R612Vy9 +Ka81Mja9NdwrgAeLAagW3hMqekzaYi1+DKS2WvVv+NrRufpQn/tDUSoh602ECQ79tFg Dk7mxWPwdfRd/8wAYZGNynaObN8nK17rsuoyKy5qLtu4Z/VYqnmFJg4e28fmVW6kkX8a Ap+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=krxRJ1NgiX0wYZj+L6Itj31eMQtDDs2tUu0uOQQxSIc=; b=gEo+DA6NGmFf7x/pYVZbZb49WSVmawqVLeEtkGpQQfiBg298Omghwdu4YDkz6ReloI CGc+HVTwGEq7sJhZ/y1th0diplVTzHBSUN7UtZJ/vUTGrjH/uL0s+V82h15G6Bfg0+QZ WjnIl2ewSeAkjzeXWRURRsJmgqYNv01OUcWqurA/pfaHdD0pKfg25j40K4+IPE1oJ4Pi 8V/CczJ1yMww2iRvF/lPu6V56cMY3LAHOvmjiBvcr1Aw/bteKhPTihXuXrNF0VTn4k0o U6Z8Lam5fZ/O1kuaAWJk8Xx9EON93+/3cuknWpFWQ1ua1QzvfdX/iK0Z31/35XFOkf0f oZJQ== X-Gm-Message-State: AG10YOSC8GsE6mrtR9Kt2LzEJeh423KoJ4m9KsYQLiqEdjib0UH7R0Jvn/isoSud/irE2g== X-Received: by 10.98.13.150 with SMTP id 22mr34106207pfn.143.1453889520246; Wed, 27 Jan 2016 02:12:00 -0800 (PST) Received: from arch-kern.gctsemi.com ([211.106.186.1]) by smtp.gmail.com with ESMTPSA id q82sm7129341pfi.37.2016.01.27.02.11.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Jan 2016 02:11:59 -0800 (PST) From: Byongho Lee To: linux-btrfs@vger.kernel.org, dsterba@suse.cz Subject: [PATCH] btrfs: remove redundant error check Date: Wed, 27 Jan 2016 19:11:53 +0900 Message-Id: <1453889513-9696-1-git-send-email-bhlee.kernel@gmail.com> X-Mailer: git-send-email 2.7.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP While running btrfs_mksubvol(), d_really_is_positive() is called twice. First in btrfs_mksubvol() and second inside btrfs_may_create(). So I remove the first one. Signed-off-by: Byongho Lee --- fs/btrfs/ioctl.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 1568f57a3376..d2f29c70d865 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -844,10 +844,6 @@ static noinline int btrfs_mksubvol(struct path *parent, if (IS_ERR(dentry)) goto out_unlock; - error = -EEXIST; - if (d_really_is_positive(dentry)) - goto out_dput; - error = btrfs_may_create(dir, dentry); if (error) goto out_dput;