Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3510969ybz; Mon, 27 Apr 2020 17:24:27 -0700 (PDT) X-Google-Smtp-Source: APiQypImPoVEAcuHM3xQj8JFRobdRbInTJUTKGC0gb1Di1m9fYMCqfyY7aDtdnuLopb+/Gorrzty X-Received: by 2002:a05:6402:28e:: with SMTP id l14mr20230120edv.184.1588033466999; Mon, 27 Apr 2020 17:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588033466; cv=none; d=google.com; s=arc-20160816; b=RrXXKEASyqF4byIN1SMfmOoiGW8m4pVpidmNPQdGylfGa6Bc456XoWyhStUBBvCNec AHSTOZ9r/wL9ggzpLE+CFL+LOLW5BWtXKqmAV5veW5QJTgfLxP9nvSFzAgM+H0h/tVZq 2uC0aYSWFLR+lpplIHik6wXGa0yeWwHmV6oYW7idoU00iVL1CJBrTuIbgF8iANOjX2d8 6xTcX51ydjV3tNT294imkjcFodM/pw8rR433QyV+eTys8tmdZDA8znVsfqQe3TXeD33m lcq5Cl7TNyOZPoGNqKCkAFPXsj+zKxSivELaDuIoGI1K968PxM56hprqpwDGHUEiNNre IvAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=yqgrwE7q7MdJKOb1Rgn9dZ6MewkkO8/L8lVY3B0gGaA=; b=G2oyouVtiRuQ7j84b3nB9aXdLjzD7BgRH3JqIob66aQbydAWC7faPsTbyomfYQD5Eb 924LFvVAJtmHjB+G4RFRJEOvSKlL+XxmWtmKrKXIPqTCAf/6uy0owuSAVnqK+har/8pt Fi2+3/6hQ8/unl6L970ml8jlXmvQe9tfxSakKRodG8wtMw7kL7IIabxgAZeQwmZtKYsG ptzfJ+LvFCP5v9SPrG1qwIiX243gK2N1lBqTu9u1f86xCTPJNdtX2EbxPQaxx6sHPBmo MYCj7a7JbQalKnPsKmMcC+/cCOwjhaLW+ElcLHWBJgQbKrC85xVDLibsBuCCZ517HYvR fn+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p13si784176ejo.283.2020.04.27.17.24.03; Mon, 27 Apr 2020 17:24:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726413AbgD1AVs (ORCPT + 99 others); Mon, 27 Apr 2020 20:21:48 -0400 Received: from mga05.intel.com ([192.55.52.43]:40690 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726233AbgD1AVr (ORCPT ); Mon, 27 Apr 2020 20:21:47 -0400 IronPort-SDR: 5I+h9wpec3M5t/LMY/OXixjbjJtBTqUjRccg5xbFg7dHXqXgiyN8yWc/foGvKhJ4wQnMV7GCYQ WCHchg5bIKgQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2020 17:21:47 -0700 IronPort-SDR: 8HXR028P2Jqh6f3cFIkVcptTXE6rTaUHplYnb/zxCMhtfdmToUdOJ4YjVd7Jj2eEaswyGCq75m azAYa/ZGxVqQ== X-IronPort-AV: E=Sophos;i="5.73,325,1583222400"; d="scan'208";a="246331329" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2020 17:21:46 -0700 From: ira.weiny@intel.com To: linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, "Darrick J. Wong" Cc: Ira Weiny , Dave Chinner , Al Viro , Jan Kara , Dan Williams , Dave Chinner , Christoph Hellwig , "Theodore Y. Ts'o" , Jeff Moyer , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org Subject: [PATCH V11 01/11] fs/xfs: Remove unnecessary initialization of i_rwsem Date: Mon, 27 Apr 2020 17:21:32 -0700 Message-Id: <20200428002142.404144-2-ira.weiny@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200428002142.404144-1-ira.weiny@intel.com> References: <20200428002142.404144-1-ira.weiny@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Ira Weiny An earlier call of xfs_reinit_inode() from xfs_iget_cache_hit() already handles initialization of i_rwsem. Doing so again is unneeded. Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Ira Weiny --- Changes from V4: Update commit message to make it clear the xfs_iget_cache_hit() is actually doing the initialization via xfs_reinit_inode() New for V4: NOTE: This was found while ensuring the new i_aops_sem was properly handled. It seems like this is a layering violation so I think it is worth cleaning up so as to not confuse others. --- fs/xfs/xfs_icache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 8bf1d15be3f6..17a0b86fe701 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -423,6 +423,7 @@ xfs_iget_cache_hit( spin_unlock(&ip->i_flags_lock); rcu_read_unlock(); + ASSERT(!rwsem_is_locked(&inode->i_rwsem)); error = xfs_reinit_inode(mp, inode); if (error) { bool wake; @@ -456,9 +457,6 @@ xfs_iget_cache_hit( ip->i_sick = 0; ip->i_checked = 0; - ASSERT(!rwsem_is_locked(&inode->i_rwsem)); - init_rwsem(&inode->i_rwsem); - spin_unlock(&ip->i_flags_lock); spin_unlock(&pag->pag_ici_lock); } else { -- 2.25.1