Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp702785ybf; Wed, 26 Feb 2020 21:33:01 -0800 (PST) X-Google-Smtp-Source: APXvYqyMqQSFQyocW5FsiVKMpiJVKY9xDblPcH9beJ2FWodYyLgSUYW5aKLvuDjfIeb2seG1a/P8 X-Received: by 2002:aca:ab53:: with SMTP id u80mr1997332oie.94.1582781580972; Wed, 26 Feb 2020 21:33:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582781580; cv=none; d=google.com; s=arc-20160816; b=qPYkJoXU9MMHiUuT/bt+pOCk6/l4Ok/FDwQlmB+8WphGnvXWvFy0fMFOsyShbW58yl /DpTIgzkE2mnNvEvQin57pVZaUtvKxqeOALAqYqAOEguWOJ8pAifAmEvBkryxs+7svmu BZMZobaVCqWNnKvI899F1MnOglRrKTvW/uoqHwR5fIL3vvw/DjliQx9WAhl3+pxGXeiS EVg8fRGxlS58MOSSEI+RYsyk/NW4B1g0UJ0lN5tXab2cnhkRh0xCiuc5I2+kkILiouxO 1CHS/E6b7bkjweRwRrzATYFvJF2beudIdeX9YCdTInM8MCCTko3kMj+0+LbVZNFduDnA 96qw== 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; bh=c9e8KtqtRmsdCCOvK7QGF+Jer/jZVAAEGqLqLq+Xw3Q=; b=YwmcTX60+JQuKiSyxilEaUWqSBeBmnhiwOnHHrotr68BNez5kYUoL8UL211hqW8+wn KPCLSKK8tgnvLUGdefHCsm/l9iMA6XihD3PT6mRuYhjVXjsI2XVsCgFSq4PkmMTigTWm +iV/IP1zwCmMdU87kwYD/jqpsDC8TQ79qozCN9wAzyJESPpiONSWh7o+cwbFcGGZxaw7 R5oA6jnP+wt/AZTI0PHtUiN0lS9GWOJi0kUq4m3SQBcRvCaIQnhaExcQIfKrRobAX5tD 4qCkladMZpEWwT0jVxB16LDrFo82Dhq79lm9Rb/MDRVI6GUdNV4bIkNn+K+lLigP8S66 D2Vg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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. [209.132.180.67]) by mx.google.com with ESMTP id k13si768307oij.118.2020.02.26.21.32.45; Wed, 26 Feb 2020 21:33:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726915AbgB0Fck (ORCPT + 99 others); Thu, 27 Feb 2020 00:32:40 -0500 Received: from mga12.intel.com ([192.55.52.136]:15192 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725769AbgB0Fcj (ORCPT ); Thu, 27 Feb 2020 00:32:39 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Feb 2020 21:32:38 -0800 X-IronPort-AV: E=Sophos;i="5.70,490,1574150400"; d="scan'208";a="226996288" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.157]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Feb 2020 21:32:37 -0800 From: ira.weiny@intel.com To: linux-kernel@vger.kernel.org Cc: Ira Weiny , Alexander Viro , "Darrick J. Wong" , Dan Williams , Dave Chinner , Christoph Hellwig , "Theodore Y. Ts'o" , Jan Kara , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH V5 01/12] fs/xfs: Remove unnecessary initialization of i_rwsem Date: Wed, 26 Feb 2020 21:24:31 -0800 Message-Id: <20200227052442.22524-2-ira.weiny@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200227052442.22524-1-ira.weiny@intel.com> References: <20200227052442.22524-1-ira.weiny@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ira Weiny xfs_reinit_inode() -> inode_init_always() already handles calling init_rwsem(i_rwsem). Doing so again is unneeded. Signed-off-by: Ira Weiny --- 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.21.0