Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3063712ybb; Sun, 12 Apr 2020 23:04:17 -0700 (PDT) X-Google-Smtp-Source: APiQypJtd7mc+3MAXC1n+mvk4dNh1qqb8laNiMCBGgtv9y6Eii23X6nz46CiK641iMnP7aZGsJp8 X-Received: by 2002:a37:a806:: with SMTP id r6mr6451420qke.171.1586757857575; Sun, 12 Apr 2020 23:04:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586757857; cv=none; d=google.com; s=arc-20160816; b=tU/Aeqcu9k5DkB1q6P1b9L8iqW2LPIYifxxe5DASJExCgNc9BuNechftf1Tjo4Cd7I TdRI7ARsnHCqcRBS3dUH8FUgJSu2p4KD+o2oQ8pJqTdUfAXo1iUX9JMlu7q7RqfMQVrc NIpu44Xh0Sj7n47QvD0b0ZGYnVYD3/0K9fHRnTMLKGR2l3QxWN2X/ncSAG2oDFOtXd3Z HyUYjTk0hAHEHpUW336JGMkjQ+3eunbUr8+c40EE2xRKRHmDOKAouO8ETyIYWG7hty3/ LXKE+qJyTgPBfYMLESOrHyKddAPdLWkKUr+3A+jX/TcOZ9iXMunAglI/iUzoL7vJfsqK Op5A== 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=xTAMnoK8+C4XohtqdDF4ZbpOWt1j4YddYSy/nKXJinI=; b=ntdEkpnNP8ft0m9c/V5yA4m2j3U00EKIsiIb07pfUsBbHtFPydSN4+OHGQu9lIWD7m ydRV/5Wk/MaraMBWBKc5hd1D8I+oMh+QyLv9cW/SNJRp6rVX8GtpjxUHAmsXrT0GDg76 AZXD5uxDtK5gObh5/zNac23QwzPxvrZ0Gcf3LVOmWtAMVmh0PdwBvXe6JIOIELF+xaCx TZPOccit+cI2JqmmMuuWZpW3ogsKowNrWXrqLtF5wMy0VU01yvxm8zBBDySqdBEHReuG JYRR7RgsWyt2BrrhiTs/Uy4yYlunQXy/xS9hZkptERJJaDWWDC+5iYl+VqeyMFWsdq53 PTrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 209.132.180.67 is neither permitted nor denied by best guess record for domain of linux-ext4-owner@vger.kernel.org) 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 ([209.132.180.67]) by mx.google.com with ESMTP id e15si5436842qkl.70.2020.04.12.23.03.56; Sun, 12 Apr 2020 23:04:17 -0700 (PDT) Received-SPF: neutral (google.com: 209.132.180.67 is neither permitted nor denied by best guess record for domain of linux-ext4-owner@vger.kernel.org) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.132.180.67 is neither permitted nor denied by best guess record for domain of linux-ext4-owner@vger.kernel.org) 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 S1727948AbgDMFlR (ORCPT + 99 others); Mon, 13 Apr 2020 01:41:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.18]:42632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727818AbgDMFlQ (ORCPT ); Mon, 13 Apr 2020 01:41:16 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10CF2C008675; Sun, 12 Apr 2020 22:41:16 -0700 (PDT) IronPort-SDR: yZTdJtDILV00IEyjMkoXG9n6HQFzFEc0P1ivVP5cZ96llsRcUbHyCzpoCmCDcIkV05eXsGPfzj YwuU4zVoz/lw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2020 22:41:15 -0700 IronPort-SDR: FIn3r0wUoMZh08t8zPbDByULCakW4jMHVbPRtY8f7MRuMkH5YsOlo6v8dt+jYNf/L5MzhRsY7S uKuTalPqniDA== X-IronPort-AV: E=Sophos;i="5.72,377,1580803200"; d="scan'208";a="276800915" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2020 22:41:15 -0700 From: ira.weiny@intel.com To: linux-kernel@vger.kernel.org, "Darrick J. Wong" Cc: Ira Weiny , Dave Chinner , Dan Williams , Dave Chinner , Christoph Hellwig , "Theodore Y. Ts'o" , Jan Kara , Jeff Moyer , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH V7 1/9] fs/xfs: Remove unnecessary initialization of i_rwsem Date: Sun, 12 Apr 2020 22:40:38 -0700 Message-Id: <20200413054046.1560106-2-ira.weiny@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200413054046.1560106-1-ira.weiny@intel.com> References: <20200413054046.1560106-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: 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 8dc2e5414276..836a1f09be03 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -419,6 +419,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; @@ -452,9 +453,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