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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 16C56C33CB2 for ; Tue, 14 Jan 2020 21:51:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB6CA2187F for ; Tue, 14 Jan 2020 21:51:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728921AbgANVvD (ORCPT ); Tue, 14 Jan 2020 16:51:03 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:52545 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727102AbgANVvD (ORCPT ); Tue, 14 Jan 2020 16:51:03 -0500 Received: from callcc.thunk.org (guestnat-104-133-0-108.corp.google.com [104.133.0.108] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 00ELoN8O028997 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Jan 2020 16:50:24 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id 5833A4207DF; Tue, 14 Jan 2020 16:50:23 -0500 (EST) Date: Tue, 14 Jan 2020 16:50:23 -0500 From: "Theodore Y. Ts'o" To: Christoph Hellwig Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Waiman Long , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Will Deacon , Andrew Morton , linux-ext4@vger.kernel.org, cluster-devel@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 08/12] ext4: hold i_rwsem until AIO completes Message-ID: <20200114215023.GH140865@mit.edu> References: <20200114161225.309792-1-hch@lst.de> <20200114161225.309792-9-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200114161225.309792-9-hch@lst.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 14, 2020 at 05:12:21PM +0100, Christoph Hellwig wrote: > diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c > index 0e8708b77da6..b6aa2d249b30 100644 > --- a/fs/ext4/extents.c > +++ b/fs/ext4/extents.c > @@ -4777,9 +4777,6 @@ static long ext4_zero_range(struct file *file, loff_t offset, > if (mode & FALLOC_FL_KEEP_SIZE) > flags |= EXT4_GET_BLOCKS_KEEP_SIZE; > > - /* Wait all existing dio workers, newcomers will block on i_mutex */ > - inode_dio_wait(inode); > - > /* Preallocate the range including the unaligned edges */ > if (partial_begin || partial_end) { > ret = ext4_alloc_file_blocks(file, I note that you've dropped the inode_dio_wait() in ext4's ZERO_RANGE, COLLAPSE_RANGE, INSERT_RANGE, etc. We had added these to avoid problems when various fallocate operations which modify the inode's logical->physical block mapping racing with direct I/O (both reads or writes). I don't see a replacement protection in this patch series. How does are file systems supported to protect against such races? - Ted