Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1138775ybz; Wed, 22 Apr 2020 14:22:14 -0700 (PDT) X-Google-Smtp-Source: APiQypIl8JopbM1w+XiHhvzYWU8P+8uj++VqUVn+z/OUDJcLStrjbSGleKdVvQz7+AEgjm1Pkb/5 X-Received: by 2002:a05:6402:30ae:: with SMTP id df14mr458948edb.86.1587590534262; Wed, 22 Apr 2020 14:22:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587590534; cv=none; d=google.com; s=arc-20160816; b=Fc0rO9ptSWO4GVVvTHJuFOe6M/tynQDRvUPPXJFRdTzt7Slwwr2A+EwaaXm9QEwMC+ CnxZc8sYD6NCHFwNUYTVa7s2tVSSqR8bu/H9/CZ1QqW/Wx8kw5nIDQKDel/1wHLsP2/q +Xn8fGks1Src7IAYqxb8DBF3gi8aHwiWNTkd+FeXKfHn5N1DYUkAbCP8YdWz3RhGJuIq 9ktu4q+osI+uTWAls8HXAKfMXPJrRrzteOMrCVf5M3bHpk59BdLlK5xpExcCQ8N7usZW SDu2l5/57Die0c8kM2kUy8bU+MG1lXbz9EiH3k81W+c+07tR/8YXubvTGOlGwj6B1ytL axvg== 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=dhLn8oTx3MBCAlvyp5vW2JEEmh0JgbEWUueFPOt8UwmqMRlvL1jrT4E10FtXbyK4Ik rcvA1YdDSta1BKrWfZZZC7HHRL9SHHDeY4PGw4Xlx107grVPktLZgduO/G5A8PR86XFE X3OvYc8+I9PeZ0S4R/uwI6OHTFasmo6QkQGPCuFzG1B5OYgac5ibFLOpAcx7evybUDz9 BSgA+AB+BJ8EHXXPo/EOOfguKaK3wUxfCBHBDph8BrBpBbEhNepmCEdXNe3gITJ3QLzq PH/1Vzua5JVEh8Mu2gmB2xQCUEeyoR2H5P8CXSGAPkWaLk7Ey9pYsQSiKyfDE6eCWPwW BVJw== 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 k11si202080edk.406.2020.04.22.14.21.44; Wed, 22 Apr 2020 14:22:14 -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 S1726715AbgDVVVV (ORCPT + 99 others); Wed, 22 Apr 2020 17:21:21 -0400 Received: from mga11.intel.com ([192.55.52.93]:12966 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbgDVVVR (ORCPT ); Wed, 22 Apr 2020 17:21:17 -0400 IronPort-SDR: 8jgz5v7oP61vjBrS3pxlGp5iTyIx3u9IvJ8XLqXH0RJAu4ax3EhQpNZTpMnW0PtuMPRCSDs7Vr g0d2X3djZdzQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2020 14:21:16 -0700 IronPort-SDR: kExJ3fAAktfWxz+ppsCTqVQnwvQ/6bsHAHMHFol38eHebWnqp8A5j0haWRKOXkoRq1nigFjYaP UFN9bhcJ1fWA== X-IronPort-AV: E=Sophos;i="5.73,304,1583222400"; d="scan'208";a="334752640" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2020 14:21:16 -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 V10 01/11] fs/xfs: Remove unnecessary initialization of i_rwsem Date: Wed, 22 Apr 2020 14:20:52 -0700 Message-Id: <20200422212102.3757660-2-ira.weiny@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200422212102.3757660-1-ira.weiny@intel.com> References: <20200422212102.3757660-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