Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4645239ybb; Tue, 7 Apr 2020 11:30:39 -0700 (PDT) X-Google-Smtp-Source: APiQypKg3rDMPGFeWhf35Q3zLTTwVFR1FqIyTZpPhqDQBMzOJXt8l3E57NlxCVOBFVekkfOhiM3e X-Received: by 2002:a9d:19c8:: with SMTP id k66mr2779043otk.186.1586284238929; Tue, 07 Apr 2020 11:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586284238; cv=none; d=google.com; s=arc-20160816; b=r0PfJWzfc5WQVQ4w44PxZh/1V4NMZsrxw7qrl9TJ1+8EcCgtHUaDFYYBGoMucpmq4e Ml58cbRdomjhukT1hK+vmrTN5BGLehZeijIKYfTMkiUL+VrKXJmXnaWdu8u2K2cIcyAm SBUULbTcgfBI2/6V7WUFnVTdUD0+cnHuutkMsC0mCN/F8ztyCSo9riJoHkQSv7Ac+roR jke5OgozjVYNkgfFIvPQ58rXrmzT2nByLwDqSdWYa9OqbM8h9DhmtDsHVCSdL7geUbfd tZQhLzrDXOkfKi9x8LPvNCuXIGiabEwpXI4jReTBvTlah8qYhsHIGMU9QP1t9MQbQQHO G/bA== 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=c+IXXz/srgMZRvf0zBYsSDfWcQwpenWjJEqt6Zf7Zgw=; b=ABXBlKl3tjou+TWoBwIxIGIS3zYsq11UrDVLekUNUqWdmCH6GnhBmCuK2esXgpcgR2 m4go23IVM2ZP0yvW5/Pnbn9/0x4q7PO20N2mkVflVZOtLtMe015wQxWdY/rYFlNTCR6L rzz9556MzuxJk/LrXqX6B6VIIX5OIaZnNBQ4tPtXogNC6qFqB4VfUNC0KLoV2Hd+GgZl m8Pfmb7cfcwUoC9cUlfg/f83Jm4J/Gew59mmhmYyyELLdZdldk/NZQsG50HYJNpYjlyy dgWEcNWyFBzj7Ssq3v6E5kzzbtBtaDYkPF4AnmKIAK2kqJlTRQ6GyT8lTO/ngtfCyfxI SaJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id x12si1465952otq.38.2020.04.07.11.30.25; Tue, 07 Apr 2020 11:30:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 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 S1726718AbgDGSaS (ORCPT + 99 others); Tue, 7 Apr 2020 14:30:18 -0400 Received: from mga17.intel.com ([192.55.52.151]:16889 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726332AbgDGSaS (ORCPT ); Tue, 7 Apr 2020 14:30:18 -0400 IronPort-SDR: YKOMkBWL1CsdMBNXvB+MGdjJrSI71ZZYQ7FDt8t47+imrX6HDUmLB8lYZoGvWWst9AYftiHBfR kuM5He5S0q7w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2020 11:30:17 -0700 IronPort-SDR: ePAZbIsRrsS6UG/p1hoq5+CTsUq3/kNY0KQagI7Q0ee3lR7deqMEjFShf+a0mnWzHO9bl0NGxn a/e+JK15sQZg== X-IronPort-AV: E=Sophos;i="5.72,356,1580803200"; d="scan'208";a="397947609" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2020 11:30:16 -0700 From: ira.weiny@intel.com To: linux-kernel@vger.kernel.org Cc: Ira Weiny , "Darrick J. Wong" , 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 V6 1/8] fs/xfs: Remove unnecessary initialization of i_rwsem Date: Tue, 7 Apr 2020 11:29:51 -0700 Message-Id: <20200407182958.568475-2-ira.weiny@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200407182958.568475-1-ira.weiny@intel.com> References: <20200407182958.568475-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. 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