Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1265584ybv; Thu, 20 Feb 2020 16:42:55 -0800 (PST) X-Google-Smtp-Source: APXvYqyHFzs6u48bLsaohUSMhXVRa1cJEDFhjvIksstIz8XxJmPzFX2B0xJxSmN5N/E19zCWKPcF X-Received: by 2002:a9d:4d99:: with SMTP id u25mr12511479otk.216.1582245775756; Thu, 20 Feb 2020 16:42:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582245775; cv=none; d=google.com; s=arc-20160816; b=B7ndDt6AZn6Utmfb2OK3TEX2Z+Zd7udyVKzmojwwBS9RvwiIryikFYnYFcQMOFl7QB LvBj6+HCQPOSe3opnmBxR+g4ITFygFcvS4u8uqMb/dbyfTGZ5EK+Z594RVDHgmH6p0Zd sQ3aiWG2fh1jII4v+tB/n+zzoWpI8lbvx5A+j7zOcv1GaxumH5auX8tFMQJWpdjBO6zl 5eg1Xt5xHYPjYscK8scqfMM1+hXRepdtjPYlvB43IVF3embsx7meu0oTxyH2Y7dHOfDa /oBV6t8xNcgd0+qkoWC1RDwc0ZlygOwMZUpHYebSM4JmBfZy8X7Ib9wA7KX7WyBvf6KI 4F7w== 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=oMFNzfKcPJfuZcHOGb47CRuz2VWKuJven+wH5pGadAihLS4Yn1DHbIBM/jPYHzBhWn aEJRO009W65Gf8e+5A1LPPmFDDNM3Qj377XfWCa4XPAgiKs+uvKAN8l85IP38bYrYRUJ O6ipyWh5DaAJlf5t1qml6cRxtOLdJsz4UVQuJW+MGgaiPBGRjSWyW8Dak8AWDwoVCHg5 m5iBLgC02qNfwTRXMpyil2D62KuWTRHyTom8pn8FfT4KAVgk994ok8aXanaVKbR9wI8v AlXQx7O6thMgXXD3wtTambUHYWi/YOtARsiOrfHe7ZHHUbU6kDhlxIo0YQY8v/i0Haa4 xv+Q== 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 q131si481275oig.203.2020.02.20.16.42.43; Thu, 20 Feb 2020 16:42:55 -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 S1729574AbgBUAlk (ORCPT + 99 others); Thu, 20 Feb 2020 19:41:40 -0500 Received: from mga02.intel.com ([134.134.136.20]:20199 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729461AbgBUAlj (ORCPT ); Thu, 20 Feb 2020 19:41:39 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2020 16:41:39 -0800 X-IronPort-AV: E=Sophos;i="5.70,466,1574150400"; d="scan'208";a="236419934" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.157]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2020 16:41: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 V4 01/13] fs/xfs: Remove unnecessary initialization of i_rwsem Date: Thu, 20 Feb 2020 16:41:22 -0800 Message-Id: <20200221004134.30599-2-ira.weiny@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200221004134.30599-1-ira.weiny@intel.com> References: <20200221004134.30599-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