Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp812825rwl; Thu, 10 Aug 2023 01:51:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFMWK8np112b/myVrRGdcb291yJdWlcLqxd6+saT7ev9CP7NDfw7M48RLiha0qQ0UWeTGMj X-Received: by 2002:a17:906:1ce:b0:966:17b2:5b0b with SMTP id 14-20020a17090601ce00b0096617b25b0bmr1594705ejj.49.1691657489880; Thu, 10 Aug 2023 01:51:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691657489; cv=none; d=google.com; s=arc-20160816; b=vg3v2+NUmkShuvCrDX+LC4hH2flJiiIrMdgGoCIMWZx3hfwTfQBT5MdKoU7Micy/Us sXrluNrtLADud57tG7BW+YDxGZQYCyYvwkSc6/XWuOQGqTSRaw5DYmLa2E8OQ3i3tBUo eznsdyIKuKwrG6NSfew7bhYBHGMHJ57HfuHSrpbw4gU7yZ6hmszoLvllMOk1uENeEDfS TqFxdhJtsQJaTntCGE0lQL/8AmD2EumDQ4zZ097MuchH6Jh+MFAYKb5nhVm2KG+nkeZt SHDMA3trVYUGbm6SkSu/ycWS7xA6Xxr1SPN/qycsp/t4rt6I0WTxnNFoQb7hBgmB8QMf 5Y2Q== 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=gdL/MziCwb2okfLN+TuKJkUIjWTWFAOHO9ZO4yBC628=; fh=wDMgXrKvu5sJO64bO3qZjdDKU9ofCN04lduSIF+nQjw=; b=tt9vK2aTrDAsdI40hCsvLePTDPowZxt3boF0mWhVUf/B+BN3B00FBgWa1xC+5560Qx jKXlseMKEIhvWvP9BIRsjc8q9v3MQOR6HrQBpi1toEAnfZN6hBE1WR47URLP1MQxYLEk jloZDcrkHI08kfh6S58MHAyCtRYoAPXgRxp10Ovsiqu5qIHgAYoIwe3jk9Fxrz/t+dz+ lyT/vXIeqgGlyd+RFpFyGhIFr8XLJpoktuGfHCeSbNUHyhIeWTEaeigtSqmG/ixf9Q4O S1pUhfwSkGRh+Lgwl3DwgehKis1K6rEsUyGcewPcNEh7rbK1EHaMpDpqLetSowXLj9R6 Fcog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M2jnnle2; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i20-20020a170906251400b00991df86ac0esi1100972ejb.338.2023.08.10.01.50.59; Thu, 10 Aug 2023 01:51:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@kernel.org header.s=k20201202 header.b=M2jnnle2; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230505AbjHJIUS (ORCPT + 99 others); Thu, 10 Aug 2023 04:20:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbjHJIUS (ORCPT ); Thu, 10 Aug 2023 04:20:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAE5DAC; Thu, 10 Aug 2023 01:20:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7406064821; Thu, 10 Aug 2023 08:20:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51C0EC433C7; Thu, 10 Aug 2023 08:20:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691655616; bh=vkpB0KymfAHadNZg+1KHRj1yxHafNU8RXYifonw0meo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M2jnnle2t4DlMDLubGGIHqU7oPc1+V9cD7ZYRAlBIYardd0Xu3v/Mtlvc+h0vEAxX 6So+eaOBkkY6ufhPZPXLxFy8Z6Dg8EabpjfaaSjPv3XFd4L7AOyhfoZ76K5zHa0EbZ 2YXllfejU96WbzGV/hmrdeEEmKN5Usy3Ogc9DKUiRq7Ksi+LFydsVYRXfFe4MBopAj 9Auj7rm3Ql6+abI04i5dIucMXMdOMimkOgjxa3a8NdiIMHJiwTGdhAcas8PnIONiBM 9IME5pWvbPYFbWHG9z8hCvoVwQvMYQ5s82tqFgKNhqv9hox9AT+SoTGahF7Kn17+vk d7tWWKVYT4mRQ== Date: Thu, 10 Aug 2023 10:20:11 +0200 From: Christian Brauner To: "Darrick J. Wong" Cc: Christoph Hellwig , Al Viro , Namjae Jeon , Sungjong Seo , Theodore Ts'o , Andreas Dilger , Konstantin Komarov , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, ntfs3@lists.linux.dev, linux-xfs@vger.kernel.org Subject: Re: [PATCH 07/13] xfs: document the invalidate_bdev call in invalidate_bdev Message-ID: <20230810-labyrinth-weshalb-2a2e90537a2d@brauner> References: <20230809220545.1308228-1-hch@lst.de> <20230809220545.1308228-8-hch@lst.de> <20230809223923.GX11352@frogsfrogsfrogs> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230809223923.GX11352@frogsfrogsfrogs> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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-ext4@vger.kernel.org On Wed, Aug 09, 2023 at 03:39:23PM -0700, Darrick J. Wong wrote: > On Wed, Aug 09, 2023 at 03:05:39PM -0700, Christoph Hellwig wrote: > > Copy and paste the commit message from Darrick into a comment to explain > > the seemly odd invalidate_bdev in xfs_shutdown_devices. > > ^ seemingly? > > > > Signed-off-by: Christoph Hellwig > > --- > > fs/xfs/xfs_super.c | 26 ++++++++++++++++++++++++++ > > 1 file changed, 26 insertions(+) > > > > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c > > index 4ae3b01ed038c7..c169beb0d8cab3 100644 > > --- a/fs/xfs/xfs_super.c > > +++ b/fs/xfs/xfs_super.c > > @@ -399,6 +399,32 @@ STATIC void > > xfs_shutdown_devices( > > struct xfs_mount *mp) > > { > > + /* > > + * Udev is triggered whenever anyone closes a block device or unmounts > > + * a file systemm on a block device. > > + * The default udev rules invoke blkid to read the fs super and create > > + * symlinks to the bdev under /dev/disk. For this, it uses buffered > > + * reads through the page cache. > > + * > > + * xfs_db also uses buffered reads to examine metadata. There is no > > + * coordination between xfs_db and udev, which means that they can run > > + * concurrently. Note there is no coordination between the kernel and > > + * blkid either. > > + * > > + * On a system with 64k pages, the page cache can cache the superblock > > + * and the root inode (and hence the root directory) with the same 64k > > + * page. If udev spawns blkid after the mkfs and the system is busy > > + * enough that it is still running when xfs_db starts up, they'll both > > + * read from the same page in the pagecache. > > + * > > + * The unmount writes updated inode metadata to disk directly. The XFS > > + * buffer cache does not use the bdev pagecache, nor does it invalidate > > + * the pagecache on umount. If the above scenario occurs, the pagecache > > This sentence reads a little strangely, since "nor does it invalidate" > would seem to conflict with the invalidate_bdev call below. I suggest > changing the verb a bit: > > "The XFS buffer cache does not use the bdev pagecache, so it needs to > invalidate that pagecache on unmount." > > With those two things changed, > Reviewed-by: Darrick J. Wong Fixed in-tree.