Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1358245ybf; Thu, 27 Feb 2020 09:26:15 -0800 (PST) X-Google-Smtp-Source: APXvYqz+2RlXGlkZCVq9CCAVR8Oj+Uza/xF8CM78ew+6KBVTGhPHzWkuDdheai7Ab4VRsJcE4l9G X-Received: by 2002:a9d:4f17:: with SMTP id d23mr6867otl.170.1582824375460; Thu, 27 Feb 2020 09:26:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582824375; cv=none; d=google.com; s=arc-20160816; b=v+Mj0+GRS5XZwoWiTaCMUb/shrjBpH+e4sw7g6RlTiauEqn9GyZbTMwVSCS8UC2hyV VyixHmU1vkKupKMgXVM/Ye0bHf/P8stx/94q2PHfVJ/sl04Qp8phtudPi3K3UsbciJs3 Hd6sR6Zk0EpCKDI0D3+edSkMSi/vxfWGmTReD1WoeBuOoWEOpcENlEq2aNE9aUIYLjpF sRTKivUBqZ8Y8DEqrkeGfZD22F7CNX7ptQnqVl73D4VyR/7YSeSlvFWKFILL9R0KRe9p viwGyhgprlrfebz3NuLbscZ8e4tABzkdXKLf/Qwqp3fr5D8Qletx0aMaj+008Bm/YWFg fwZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/Hg2awzeui5/vj2QTbgSeFleYfcz2/Ttuj9x7g4fJuI=; b=uIl8yl/iYQCsAVXnTZZ6wBh81lBgTS2H+t3+GVXsoDXD6jxbKW0wH5pBayR9Bvsnfv hHxuQKX1VrT97koG98oWYWSg1gmABtY9bRxxXlVpT73/ljfQblOT09BaN9FHq3aCSEfe K6u/N2FvqMzc0S9XVlF+L5WN69nOVrEQGhmZqxw+q1lYw95TYpT86dZgLkO6rIj1lvZ3 piP2EopEZmROoHIIGJoe5pUEhJsJplrwxDi+ajqhWIm20mEN38qTZWuC6G9TxSMc4EgD 0xdpIQGD+V35IkLEhqEdIltzLBD35qByMslp036mmabLHe40bJEjmTeoFxrBP61LxKPa KAcg== 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 x84si272469oia.27.2020.02.27.09.25.54; Thu, 27 Feb 2020 09:26:15 -0800 (PST) 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 S1729512AbgB0RZu (ORCPT + 99 others); Thu, 27 Feb 2020 12:25:50 -0500 Received: from mga17.intel.com ([192.55.52.151]:47782 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729648AbgB0RZu (ORCPT ); Thu, 27 Feb 2020 12:25:50 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Feb 2020 09:25:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,492,1574150400"; d="scan'208";a="437111728" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by fmsmga005.fm.intel.com with ESMTP; 27 Feb 2020 09:25:49 -0800 Date: Thu, 27 Feb 2020 09:25:49 -0800 From: Ira Weiny To: linux-kernel@vger.kernel.org Cc: 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: Re: [PATCH V5 01/12] fs/xfs: Remove unnecessary initialization of i_rwsem Message-ID: <20200227172549.GA6468@iweiny-DESK2.sc.intel.com> References: <20200227052442.22524-1-ira.weiny@intel.com> <20200227052442.22524-2-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200227052442.22524-2-ira.weiny@intel.com> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Feb 26, 2020 at 09:24:31PM -0800, 'Ira Weiny' wrote: > 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 Ok... I'm going to blame exchange... Dan just pointed out that I mist this response from Dave... Saying this patch was wrong. https://lore.kernel.org/lkml/20200221012625.GT10776@dread.disaster.area/ Sorry, I need to read that email and look at it. Ira > > --- > 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 >