Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2710527pxb; Tue, 13 Apr 2021 08:23:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWqouNlIqAcVZApwkuqjqLYEU1cnA5faAEOQCHDCGrlEU+iYkpA3ZhNMABf4u0dwFkoLKh X-Received: by 2002:a17:906:a45a:: with SMTP id cb26mr7347740ejb.537.1618327398710; Tue, 13 Apr 2021 08:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618327398; cv=none; d=google.com; s=arc-20160816; b=CBB62EucAvl2jG9OD+W/2DrdhnyddhPX31m1lWhtEn4VdUu3QqrZ4knF2s7ye21BWJ UBJX8QpsZwihVbAUpvoIkyVNQd2eHkQ3GGb2HN5VhOKPmzNAtdrAFe1hRp1J/+ju6iB4 ydkJstYmUPjtoUmuPjXo0FzkuBxDMcuolVEs7cUbhDrUmojU8U2+QICfMZhNFBdW/Mxd rhZo+Lsgu3okjmPAxr9IUE+y14nCmHnRMQTCGJob2ySJVsuMLtVudtkC8Ind345w7zxu ZKdCHeDDEJiUSbrWvjolgAIil7EVnPlAm/lbkEERVQojZX0TpG5OxVCxBSNps1pSwzgz 69gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vBa5I9cnF6gq99nwmVfNLF184LBtNaf0t/nHm2F1SjU=; b=KmPj0tchK/YS1RA4hj18ixLVV061RT5RjQJc9Wrbl1T1uHI4Tz/llV3OjDyRoFKejV m+tvDN8T2Om/hA1ESrTSMwfUeTUrY/27ikQLS/6CGia6KJZaFXn6hiZEJQWk4G6mR953 o2QSyBJd6dfYZjV7M0mJMu9SFo6lxziFysfqWUd/qter348AvW7KzUYgtRfLoj+a2e7w pcNck1TNr0D4ufPjX5dFUDbV28CjDRZom6vpyY1tLmiiwnHrSdq6XyKZQVroTN85vfcV uqqoaz72fntwU1laEn0+g4qgoT8BRmywJF9BpP0FMiLrgE8FlcVrdxj1akwnloilBrvh ryig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=PJNh4509; 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 h16si10639478ede.206.2021.04.13.08.22.54; Tue, 13 Apr 2021 08:23:18 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=PJNh4509; 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 S231615AbhDMNK3 (ORCPT + 99 others); Tue, 13 Apr 2021 09:10:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231594AbhDMNK2 (ORCPT ); Tue, 13 Apr 2021 09:10:28 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AE25C061756; Tue, 13 Apr 2021 06:10:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=vBa5I9cnF6gq99nwmVfNLF184LBtNaf0t/nHm2F1SjU=; b=PJNh4509S/UB/1YM3kxTa7Z8Vu slvZd7GxxNVfAt2IsAcpbueGzJxG8oWB0L6NOslHl1pyA0/NOMbcQj8ACitj9VV8WZz9b+hNaS7Wy ftKsPyRCeqC8nKu0rLxr0dYFUQSgD6OSOoF4GkYhAy9LEmZ3/YJ9SNL56ZpG9ndU3Y2ok2wcOu60C m0kk8q0pSfdc1QiRP6cm23bHtLYX9e8MIeoqu0GnoXgzvUzaK6Y9v+wc8d+OlTk0X/wlko71dwOkK fS/DO+Aiq7gMCk0HVJpF3P1Qm0lDFNJh2YNesSkzt/Wv2vEIjaMVuiWxyK1s61/w6NBAqU6g9+dQK utIXcUHw==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lWIne-005leB-9K; Tue, 13 Apr 2021 13:09:53 +0000 Date: Tue, 13 Apr 2021 14:09:50 +0100 From: Christoph Hellwig To: Jan Kara Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, Ted Tso , Christoph Hellwig , Amir Goldstein , Dave Chinner Subject: Re: [PATCH 0/7 RFC v3] fs: Hole punch vs page cache filling races Message-ID: <20210413130950.GD1366579@infradead.org> References: <20210413105205.3093-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210413105205.3093-1-jack@suse.cz> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org > Also when writing the documentation I came across one question: Do we mandate > i_mapping_sem for truncate + hole punch for all filesystems or just for > filesystems that support hole punching (or other complex fallocate operations)? > I wrote the documentation so that we require every filesystem to use > i_mapping_sem. This makes locking rules simpler, we can also add asserts when > all filesystems are converted. The downside is that simple filesystems now pay > the overhead of the locking unnecessary for them. The overhead is small > (uncontended rwsem acquisition for truncate) so I don't think we care and the > simplicity is worth it but I wanted to spell this out. I think all makes for much better to understand and document rules, so I'd shoot for that eventually. Btw, what about locking for DAX faults? XFS seems to take the mmap sem for those as well currently.