From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04515C2B9F7 for ; Wed, 26 May 2021 10:18:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A6C7861440 for ; Wed, 26 May 2021 10:18:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6C7861440 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 45B828D0001; Wed, 26 May 2021 06:18:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4334D6B0072; Wed, 26 May 2021 06:18:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 285028D0001; Wed, 26 May 2021 06:18:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0003.hostedemail.com [216.40.44.3]) by kanga.kvack.org (Postfix) with ESMTP id EE2306B0071 for ; Wed, 26 May 2021 06:18:42 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 8C3A3181AF5C6 for ; Wed, 26 May 2021 10:18:42 +0000 (UTC) X-FDA: 78182983284.29.EAB3988 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf07.hostedemail.com (Postfix) with ESMTP id 956ADA0001CC for ; Wed, 26 May 2021 10:18:34 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1622024321; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Zy950XykkrJ6BQwKrm2bOZ69SbTGj6TawhTTxHONnfc=; b=wkbwouza/uoHMYVNU2DGIsOW7TInyVbvT0rZ7N1OWO6Rh+djnaSCfcAyeF6DN/8dJ1wL64 rHi+2qgfiyBeulHqBiX0hnyvOgf4l2CuTdZW8kUS6fzCEFHDQuky3UGZGOSXymBaLH4KHR Lm88zZdt8iZCUNRO0yBGBjg/FShyHHI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1622024321; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Zy950XykkrJ6BQwKrm2bOZ69SbTGj6TawhTTxHONnfc=; b=9hNfRZyzRnis/OPuk5nHQikSuG7UpjGYzqxh8Fx9LtXgJhKisRFsTmBBlUbXWJw3rWKKnj KP4FtPqoswh/zIAA== Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id DD935B23D; Wed, 26 May 2021 10:18:40 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 643461F2CAC; Wed, 26 May 2021 12:18:40 +0200 (CEST) Date: Wed, 26 May 2021 12:18:40 +0200 From: Jan Kara To: "Darrick J. Wong" Cc: Jan Kara , linux-fsdevel@vger.kernel.org, Christoph Hellwig , Dave Chinner , ceph-devel@vger.kernel.org, Chao Yu , Damien Le Moal , "Darrick J. Wong" , Jaegeuk Kim , Jeff Layton , Johannes Thumshirn , linux-cifs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org, linux-xfs@vger.kernel.org, Miklos Szeredi , Steve French , Ted Tso , Matthew Wilcox , Christoph Hellwig Subject: Re: [PATCH 07/13] xfs: Convert to use invalidate_lock Message-ID: <20210526101840.GC30369@quack2.suse.cz> References: <20210525125652.20457-1-jack@suse.cz> <20210525135100.11221-7-jack@suse.cz> <20210525213729.GC202144@locust> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210525213729.GC202144@locust> User-Agent: Mutt/1.10.1 (2018-07-13) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=wkbwouza; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=9hNfRZyz; spf=pass (imf07.hostedemail.com: domain of jack@suse.cz designates 195.135.220.15 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 956ADA0001CC X-Stat-Signature: zw1pieaq1asa8zpfh7h8ohho9r9qdcux X-HE-Tag: 1622024314-867040 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 25-05-21 14:37:29, Darrick J. Wong wrote: > On Tue, May 25, 2021 at 03:50:44PM +0200, Jan Kara wrote: > > Use invalidate_lock instead of XFS internal i_mmap_lock. The intended > > purpose of invalidate_lock is exactly the same. Note that the locking in > > __xfs_filemap_fault() slightly changes as filemap_fault() already takes > > invalidate_lock. > > > > Reviewed-by: Christoph Hellwig > > CC: > > CC: "Darrick J. Wong" > > It's djwong@kernel.org now. OK, updated. > > @@ -355,8 +358,11 @@ xfs_isilocked( > > > > if (lock_flags & (XFS_MMAPLOCK_EXCL|XFS_MMAPLOCK_SHARED)) { > > if (!(lock_flags & XFS_MMAPLOCK_SHARED)) > > - return !!ip->i_mmaplock.mr_writer; > > - return rwsem_is_locked(&ip->i_mmaplock.mr_lock); > > + return !debug_locks || > > + lockdep_is_held_type( > > + &VFS_I(ip)->i_mapping->invalidate_lock, > > + 0); > > + return rwsem_is_locked(&VFS_I(ip)->i_mapping->invalidate_lock); > > This doesn't look right... > > If lockdep is disabled, we always return true for > xfs_isilocked(ip, XFS_MMAPLOCK_EXCL) even if nobody holds the lock? > > Granted, you probably just copy-pasted from the IOLOCK_SHARED clause > beneath it. Er... oh right, preichl was messing with all that... > > https://lore.kernel.org/linux-xfs/20201016021005.548850-2-preichl@redhat.com/ Indeed copy-paste programming ;) It certainly makes the assertions happy but useless. Should I pull the patch you reference into the series? It seems to have been uncontroversial and reviewed. Or will you pull the series to xfs tree so I can just rebase on top? Honza -- Jan Kara SUSE Labs, CR