From patchwork Thu Oct 24 07:51:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Kent X-Patchwork-Id: 11208435 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0305E112C for ; Thu, 24 Oct 2019 07:51:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DFE6021872 for ; Thu, 24 Oct 2019 07:51:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408746AbfJXHvl (ORCPT ); Thu, 24 Oct 2019 03:51:41 -0400 Received: from icp-osb-irony-out1.external.iinet.net.au ([203.59.1.210]:26989 "EHLO icp-osb-irony-out1.external.iinet.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408743AbfJXHvl (ORCPT ); Thu, 24 Oct 2019 03:51:41 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AeAADRVrFd/0e30XYNWBsBAQEBAQEBBQEBAREBAQMDAQEBgWoDAQEBCwEBgXKCSIQoj0kGizOFIAGMDgkBAQEBAQEBAQE3AQGEOwMCAoNZNwYOAgwBAQEEAQEBAQEFAwGFWIEaAQwBhQECAQMjBFIQGA0CJgICRxAGE4V1sXR1fzMaijCBDigBgWSKQniBB4ERg1CHVYJeBIxqglM3hkBDlmyCLpVFDIIvi3ADEIsUqhWBe00uCoMnUIRRAQKNKWeKVoVYAQE X-IPAS-Result: A2AeAADRVrFd/0e30XYNWBsBAQEBAQEBBQEBAREBAQMDAQEBgWoDAQEBCwEBgXKCSIQoj0kGizOFIAGMDgkBAQEBAQEBAQE3AQGEOwMCAoNZNwYOAgwBAQEEAQEBAQEFAwGFWIEaAQwBhQECAQMjBFIQGA0CJgICRxAGE4V1sXR1fzMaijCBDigBgWSKQniBB4ERg1CHVYJeBIxqglM3hkBDlmyCLpVFDIIvi3ADEIsUqhWBe00uCoMnUIRRAQKNKWeKVoVYAQE X-IronPort-AV: E=Sophos;i="5.68,224,1569254400"; d="scan'208";a="250044037" Received: from unknown (HELO [192.168.1.222]) ([118.209.183.71]) by icp-osb-irony-out1.iinet.net.au with ESMTP; 24 Oct 2019 15:51:38 +0800 Subject: [PATCH v7 12/17] xfs: avoid redundant checks when options is empty From: Ian Kent To: linux-xfs Cc: Christoph Hellwig , "Darrick J. Wong" , Brian Foster , Eric Sandeen , David Howells , Dave Chinner , Al Viro Date: Thu, 24 Oct 2019 15:51:38 +0800 Message-ID: <157190349799.27074.795104447849311945.stgit@fedora-28> In-Reply-To: <157190333868.27074.13987695222060552856.stgit@fedora-28> References: <157190333868.27074.13987695222060552856.stgit@fedora-28> User-Agent: StGit/unknown-version MIME-Version: 1.0 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org When options passed to xfs_parseargs() is NULL the checks performed after taking the branch are made with the initial values of dsunit, dswidth and iosizelog. But all the checks do nothing in this case so return immediately instead. Signed-off-by: Ian Kent Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/xfs/xfs_super.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 003ec725d4b6..92a37ac0b907 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -211,7 +211,7 @@ xfs_parseargs( mp->m_logbsize = -1; if (!options) - goto done; + return 0; while ((p = strsep(&options, ",")) != NULL) { int token; @@ -390,7 +390,6 @@ xfs_parseargs( return -EINVAL; } -done: if (dsunit && !(mp->m_flags & XFS_MOUNT_NOALIGN)) { /* * At this point the superblock has not been read