Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp732449pxj; Thu, 13 May 2021 15:51:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDgqGfcF6tBs0DJA0kMCBz1ejzasG7FMzSqVWKHFq9c4Agz73CSAm/pZ/UO5c+lAmTAzvc X-Received: by 2002:a05:6402:284:: with SMTP id l4mr53649847edv.299.1620946272049; Thu, 13 May 2021 15:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620946272; cv=none; d=google.com; s=arc-20160816; b=u15qYV/1BjmMTLZLHYQPhS0PbXGQinCS8kRFxf6jM5lTj+xU9LSo0bk2VkzYgOoSrp MAkzMVtdSjbaCYZYRxm0y1znD1ppc7DyCaNH3c/ZZH5hZiyXU4Uq/a2LSlCVnB6/AyKo hFEDx6le/CJK5qjaXYusuB2LTPWLg1Pdiug2EFJKMGXQgwdt+NhDw2HRv8R3qLXE2J6H tSE+Sn6XPq9AW6Fin7QqOCw1iTOygHGswdhBrnxAeDfJKPAHRGysZarKACuOD3f8ae+W P1PRuVY4Yw0KEelEh4azjsLn59b0D+En8N1b2RoTDSaGlTBjH1sllnE6FolEwVX+gTEf /V0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=G7y4WzOlxpF/7KXfCGzr0omNw0h1rmWzHZpZNtewbxE=; b=FcB91axadIvuMDbn68gRLZyLnJ1ibrVL1DdnDEeSSPIuXeCkol5bKLl/+xCWocz6Nj 8hXvNfbuaDe08YCL4CWpiRD1FpX0B/IoDU1lUVOFgRjTR9YXeColYX3lAOaH/kqXIIBU JRdlT8yvupw7YqNw9lHHwHm7X/nYK2G8QOm5d7pBplhpqWBhz5AM7hOI4AKRGSHpOoBI ap4nTY21yHGXM15G63QyKNdrB+8OeyYBZ/f0ZCe5tA5iumB/3XCO+pc3r3z651GESE1B qfDMd16hJfkBpAC9r1tedL3TJ6x262B4QzMGCkcJH1cKeuh+WI2DHHKVpFtqsWWCCFT+ Z2nQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j10si3860704edn.595.2021.05.13.15.50.48; Thu, 13 May 2021 15:51:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231324AbhEMRut (ORCPT + 99 others); Thu, 13 May 2021 13:50:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:47272 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231322AbhEMRus (ORCPT ); Thu, 13 May 2021 13:50:48 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3F23DAF83; Thu, 13 May 2021 17:49:36 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 0670B1E0D30; Thu, 13 May 2021 19:49:36 +0200 (CEST) Date: Thu, 13 May 2021 19:49:35 +0200 From: Jan Kara To: Matthew Wilcox 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 Subject: Re: [PATCH 03/11] mm: Protect operations adding pages to page cache with invalidate_lock Message-ID: <20210513174935.GI2734@quack2.suse.cz> References: <20210512101639.22278-1-jack@suse.cz> <20210512134631.4053-3-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed 12-05-21 15:20:44, Matthew Wilcox wrote: > On Wed, May 12, 2021 at 03:46:11PM +0200, Jan Kara wrote: > > > diff --git a/mm/truncate.c b/mm/truncate.c > > index 57a618c4a0d6..93bde2741e0e 100644 > > --- a/mm/truncate.c > > +++ b/mm/truncate.c > > @@ -415,7 +415,7 @@ EXPORT_SYMBOL(truncate_inode_pages_range); > > * @mapping: mapping to truncate > > * @lstart: offset from which to truncate > > * > > - * Called under (and serialised by) inode->i_rwsem. > > + * Called under (and serialised by) inode->i_rwsem and inode->i_mapping_rwsem. > > mapping->invalidate_lock, surely? Right, thanks for noticing. > And could we ask lockdep to assert this for us instead of just a comment? That's the plan but currently it would trip for filesystems unaware of invalidate_lock. Once all filesystems are converted I plan to transform the comments into actual asserts. In this series I aim at fixing the data corruption issues, I plan the cleanups for later... Honza -- Jan Kara SUSE Labs, CR