Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3763992rwl; Mon, 27 Mar 2023 20:10:41 -0700 (PDT) X-Google-Smtp-Source: AK7set+1I49rM1b5lIfU/IjNSqYQvKZ0ghP5UFK+kIpOVRo6Xhi0JMkk47/YV77ftb5gllonGu1W X-Received: by 2002:a05:6a20:a793:b0:da:1830:328a with SMTP id bx19-20020a056a20a79300b000da1830328amr11196681pzb.44.1679973041292; Mon, 27 Mar 2023 20:10:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679973041; cv=none; d=google.com; s=arc-20160816; b=IrFQ4Qj4+QF6xx73422xNjwgIjQ8r8/cn/XRD8nquGjnEIerBi4CHZmJy313wSxFBs 4vU9RthrD4/k3jJBwTzcCIBoVxogbDq5Xk73kK4XKJ17FD6OaA1b7nl6iNChuaP3puvU 0WOH6YasKT3QcSKL3Uw01C0wFt8EjeHJkhNMjFJw3EGjrL9W0lFiybYseLL8j39ESK3L AacvJdfeNzJja+MyYucb1ZGPRDne/XPL46wYlP60P5N3Sieyqe9HHrIJlU0xTQmalINx Xc6Tla0mwmIJljhZ210Uwe807rxXfZwWR4AMKhS/M+hY74E2j2eQcPHxqjN7O0LHMjS3 3fXQ== 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=bLyr4+am2V6lTxnJ8lU/XXtylgWPWBoWpTubGjemSVQ=; b=VP/4aqjLRv6rXB28hxm8i7bz5gA6eDOMx3zeS7VB2O8UjQSi3P2nj+M0FLjwpSVDRx DozKDW8/Bz4nEr59YZoMonGIINF3gLPCctdDNCG7puQxE3c+F38LgCU2+DH5IE+36Snu NZXggY8uIi+YDpa0zCNstp1MoqA/FmVc79eDY7wHF34SFLa48l+Dj314Y8zJI5O8p9LE U9HlQGrMcJxKsk8WHDpUW8vzvNQz8Y4mETWujCFMSIdPSPMiL6JbAx8yMZOWdXR6rb8l EitzOYutM/TnwNwIzwM8Cz0EW920mecmQXoWRbht5u6kj2zVFZN9Onjen5TSsEryvBYj Rwcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fromorbit-com.20210112.gappssmtp.com header.s=20210112 header.b=kmDKU3gH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b15-20020a63e70f000000b0050bed678013si26900708pgi.10.2023.03.27.20.10.29; Mon, 27 Mar 2023 20:10:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fromorbit-com.20210112.gappssmtp.com header.s=20210112 header.b=kmDKU3gH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232190AbjC1C6Q (ORCPT + 99 others); Mon, 27 Mar 2023 22:58:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230073AbjC1C6O (ORCPT ); Mon, 27 Mar 2023 22:58:14 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 637CE2715 for ; Mon, 27 Mar 2023 19:58:13 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id j13so9578509pjd.1 for ; Mon, 27 Mar 2023 19:58:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20210112.gappssmtp.com; s=20210112; t=1679972293; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=bLyr4+am2V6lTxnJ8lU/XXtylgWPWBoWpTubGjemSVQ=; b=kmDKU3gH92RhdilP0wGx1LLk9gbqJfyl3gqvqUqlbrmn20ntkJNvBrQGFm6f4lBZYg cM9JO2XR2Geh7dy2LXv0AAuie7zc9tegJ1y9sDZf69TvmRqw6z3b2xLcgf1yZ1WdoWmT nYTNQVjIiSwPQCDP+UOj/Rl33mUVo9VJFIvXl1DnWt5WZdjDcecayQrnpdkWDTB98EHw 7ReeVUrj0Ih2stNsmEU0h9e5LslOc2jCuCRCVA1mnBuSk4XHigKIOBsqyxcgNGrff4U2 UCSoTt5fr1i74hcrVfjvVCww8u6KQGYrueDnomWZhk+jwy5TqbQ0ifKTahln9k0gjfrg ssAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679972293; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=bLyr4+am2V6lTxnJ8lU/XXtylgWPWBoWpTubGjemSVQ=; b=kIj2hjbZLaWnBnUDK3jPVF/hVKaZTTE+/QU0+ES0az+8QdcXS6GQENxF/F7kC5LS44 1shHHkm5dmGkhZv/GguwQ4dckhbfr76IO6ONEpf0xIR5WDkuw7VZc0AdLPPJoZhlwYHE X7KAZJ2CnyyeIeuvoDYr1vf33X/Ky8nwJZ2kp2elv1kcd8Ubrhnw5NJwyaA5VBem2IMU KrUPjNdNRf/Qa19xYr00uc9Z1Vs3tiXwU1LpoM52BcT3NM4CLgkeV/X/iExJBYzgx5+l 8W2BvezNNhIfT6u5xffl74lxrG9p4hyNI5YY1mY4d1IMm72xmN6NKLjDVvvsutFQa5NY LsrQ== X-Gm-Message-State: AAQBX9e4mDuoro3wnLKdZEW64eihml7ye5/GRRbs7T8x2/ifsXP1YoPD jCLkiNQZsuDGYeWkh7mdNjARyA== X-Received: by 2002:a17:902:d2ce:b0:19c:e664:5e64 with SMTP id n14-20020a170902d2ce00b0019ce6645e64mr18220668plc.2.1679972292889; Mon, 27 Mar 2023 19:58:12 -0700 (PDT) Received: from dread.disaster.area (pa49-181-91-157.pa.nsw.optusnet.com.au. [49.181.91.157]) by smtp.gmail.com with ESMTPSA id p23-20020a1709027ed700b0019ee0ad15b4sm19719243plb.191.2023.03.27.19.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 19:58:12 -0700 (PDT) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1pgzXF-00E0yH-R0; Tue, 28 Mar 2023 13:58:09 +1100 Date: Tue, 28 Mar 2023 13:58:09 +1100 From: Dave Chinner To: "Darrick J. Wong" Cc: Christoph Hellwig , "yebin (H)" , Ye Bin , linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] xfs: fix BUG_ON in xfs_getbmap() Message-ID: <20230328025809.GC3223426@dread.disaster.area> References: <20230327140218.4154709-1-yebin@huaweicloud.com> <20230327151524.GC16180@frogsfrogsfrogs> <64224406.5090106@huawei.com> <20230328014328.GG16180@frogsfrogsfrogs> <20230328020341.GH16180@frogsfrogsfrogs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230328020341.GH16180@frogsfrogsfrogs> X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 27, 2023 at 07:03:41PM -0700, Darrick J. Wong wrote: > On Mon, Mar 27, 2023 at 06:47:54PM -0700, Christoph Hellwig wrote: > > On Mon, Mar 27, 2023 at 06:43:28PM -0700, Darrick J. Wong wrote: > > > Seeing as the data fork mappings can change the instant the > > > ILOCK drops, I'm not /that/ worried about users seeing a delalloc > > > mapping even if the user requested a flush. The results are already > > > obsolete when they get to userspace, unless the application software has > > > found another means to lock out access to the file. > > > > That is true, but then again the users asked to not see delalloc > > mappings, so we really shouldn't report one, right? > > Yeah, I suppose so. I wonder how many programs there are out there that > don't pass in BMV_IF_DELALLOC /and/ can't handle that? But I suppose > taking MMAP_EXCL is good enough to shut up the obvious assertion vector. Why not just skip it? Take the flush completion as being a point-in-time snapshot where there are no delalloc extents, and if any new ones have been created racily, just skip them as being "after" the flush and so don't get reported... > The COW implementation probably ought to be doing the flush too. Yup, and then just skip any delalloc extents found after that, too. Cheers, Dave. -- Dave Chinner david@fromorbit.com