Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp935623rwd; Wed, 7 Jun 2023 08:46:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ieGHfBI0WvBm1LpUniVwIIIA6lo9kS5BCCqTBMwHv/a8mDjOjuV4tOO/ot9Iv7Z732Ssa X-Received: by 2002:a05:6a21:6710:b0:104:a096:6ac7 with SMTP id wh16-20020a056a21671000b00104a0966ac7mr3309626pzb.34.1686152798759; Wed, 07 Jun 2023 08:46:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686152798; cv=none; d=google.com; s=arc-20160816; b=nAmf/qQCs61h9wfbT5XAsClkXSQb1JQ8WzPt/t6+WjlK6TynXLZwalq6CmcEcsTtSL ro0uXUJvBEscePPeWNeQkK2yTeOU2H06cPquRN/tRTxZVhHBQqqK+qgK776u7wgPPuvk jc+3hxBLHsjtRynq13obyvHnASeGOxeMU3llcZEGBSvpWxssT6dQznY6wsC+bTqhoLnt JnDq/Gf3KtvgYIJxL9S9DpYeXWc8/bXH8oHY05n5J3sJ9gRYA9Iympsc14MHmyakoTW1 guuhoCTs+F0FSOpPbJzm4fhVDGsY9Es785VxiBEMKuv9kFk+WSt8dNcGKfcfMbmQd78x aIUw== 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:feedback-id :dkim-signature:dkim-signature; bh=Wv7B88fCXHMfzlDN3UtqKmkgxzrFTCsQxuLFkzoPHro=; b=X1Z4oJlLI+RclIwH6dqv9GvfvMc6i4ehpjX/aOUaN0H/pSS0UNnxW9kI6jikdAIGij 333HwdRWsNFBjHYdXQxuA2z621efq55vKQ1rJpKkK6guO3gZVg9Qoi80MvwguSSTEhHP OnwKKm2T4ZoR6eK1MlDQAOWjYR/TztQVg7WmNztZroIQV8AZMSU6CFJUOWhA5tCFSBE2 MGbpEdtmcsFyKBK70im701Oi6oCWL52JL7NsBATrt4ltsDOpfL0mduebVsInlA2HotHi Yb42V6pu0NUMq+OBMYEzzzsfL5Ma+IOT9RTZqpLBVsuJlAQ6bv+SCk3nkekNkyqunm9u Pp1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@invisiblethingslab.com header.s=fm1 header.b=XHoJXnU2; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=WfumrNaC; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 20-20020a631854000000b0053b88b7dd54si9042444pgy.309.2023.06.07.08.46.24; Wed, 07 Jun 2023 08:46:38 -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=@invisiblethingslab.com header.s=fm1 header.b=XHoJXnU2; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=WfumrNaC; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239164AbjFGPZX (ORCPT + 99 others); Wed, 7 Jun 2023 11:25:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241254AbjFGPYs (ORCPT ); Wed, 7 Jun 2023 11:24:48 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B71E2707; Wed, 7 Jun 2023 08:24:13 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 54D205C0083; Wed, 7 Jun 2023 11:23:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 07 Jun 2023 11:23:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1686151389; x=1686237789; bh=Wv7B88fCXHMfzlDN3UtqKmkgxzrFTCsQxuL FkzoPHro=; b=XHoJXnU2+Jkn+R2bLfxIbPT3bxyCMF5fQ0zS8CtDaGSqTker57P +kWa087zeC5Ak/d9FH1sIyKJfOUWIEPH0W+iLtAAwje6RiZiNIzNHKAKLuZBcQzy iSA8qh+dv3ecCR3pxKTD1QhHl76XcJUmsRH4JD2b3zdtTGSPFs+0BvS3My/btqlf 1QxY6VQJrkPBM/yDs5df/q66phXvfOxWuP60SCz0KAu0jOjFksl7ptO5Yad9+w91 3I4JMbOv0gOb/nITmlYw+i1RAmyT0ry3MSHecRMprLdXrSoOLf/0D/BFsVWFOM7k 45UTq+Lo+WOzCC+V7SKVWcYnC3Ie3qSwFkw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1686151389; x=1686237789; bh=Wv7B88fCXHMfz lDN3UtqKmkgxzrFTCsQxuLFkzoPHro=; b=WfumrNaC/mT4OajhXHOPWdcfHkkRO SZxV2GMvr7fjCKdu30Xlbk8xXeRJbI2KfUgBJ2UetKMClF6NadOWhoMVJbj1lEqp cRJeUFo4/rxQ+zmQI/G68XmA8Tq6x8++apsN10xmDfBDdUxsJvR/3Vm9yWfMxQxK 4BSwzZdM7ZpVYXu7YH8mF9TuYgXHVSZ63yHwIJTGJmDzZXj1EEbqdpEt8N2cVELa OC12kqNMT+udqBO0F9ZrEtpESzyCByu0HE1ih+9yzF/WBJ0vFiRfa+mw8bAHB91a I0ZIjGVNV9DekVhFswsKhRMNNj+EygWawq/0HoK06rTHZlxXEA5iBzxdg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedtgedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtjeenucfhrhhomhepffgvmhhi ucforghrihgvucfqsggvnhhouhhruceouggvmhhisehinhhvihhsihgslhgvthhhihhngh hslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhepvdejteegkefhteduhffgteffgeff gfduvdfghfffieefieekkedtheegteehffelnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepuggvmhhisehinhhvihhsihgslhgvthhhihhnghhs lhgrsgdrtghomh X-ME-Proxy: Feedback-ID: iac594737:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 7 Jun 2023 11:23:08 -0400 (EDT) Date: Wed, 7 Jun 2023 11:23:00 -0400 From: Demi Marie Obenour To: Christoph Hellwig Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] block, loop: Increment diskseq when releasing a loop device Message-ID: References: <20230601222656.2062-1-demi@invisiblethingslab.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ciKbitYsLUhZP3Im" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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-kernel@vger.kernel.org --ciKbitYsLUhZP3Im Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Wed, 7 Jun 2023 11:23:00 -0400 From: Demi Marie Obenour To: Christoph Hellwig Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] block, loop: Increment diskseq when releasing a loop device On Wed, Jun 07, 2023 at 12:42:11AM -0700, Christoph Hellwig wrote: > > +++ b/block/genhd.c > > @@ -1502,3 +1502,4 @@ void inc_diskseq(struct gendisk *disk) > > { > > disk->diskseq =3D atomic64_inc_return(&diskseq); > > } > > +EXPORT_SYMBOL(inc_diskseq); >=20 > I really do not like exporting this as a lowlevel function. If we > increment the sequence it should be part of a higher level operation. Fair! > > --- a/drivers/block/loop.c > > +++ b/drivers/block/loop.c > > @@ -1205,6 +1205,12 @@ static void __loop_clr_fd(struct loop_device *lo= , bool release) > > if (!part_shift) > > set_bit(GD_SUPPRESS_PART_SCAN, &lo->lo_disk->state); > > mutex_lock(&lo->lo_mutex); > > + > > + /* > > + * Increment the disk sequence number, so that userspace knows this > > + * device now points to something else. > > + */ > > + inc_diskseq(lo->lo_disk); >=20 > And I'm not sure why we even need this. __loop_clr_fd > already calls disk_force_media_change, which calls inc_diskseq. > Why do we need an extra increment? How does disk_force_media_change() call inc_diskseq()? I don=E2=80=99t see= any calls in the source code. I=E2=80=99m going to use systemtap to see if the= re is an indirect call chain. --=20 Sincerely, Demi Marie Obenour (she/her/hers) Invisible Things Lab --ciKbitYsLUhZP3Im Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEdodNnxM2uiJZBxxxsoi1X/+cIsEFAmSAoNoACgkQsoi1X/+c IsHQlBAAkPrxFId08lsXJQUerNo6JNd7c3rnGL/J7C1RclnoXZvb2wTxTOU7SyAK Pm0DjJ+MkEbJPCtk4mhaA75ezfDNiA66cPmmaN3xBDb9VmuqwMSUgKhEDqpvMGyD r41wCIrMIv3daXrqMbdThLX8MN9nyLNFPG2VkLK71z7Yar/3jEhTVH7JkcrCZ79C STBv9mj8oG86ycCIUrKeWpI3zFZaniO0yUqlqXEuCt9x5LZ1WQ/EG6G9kiQyJIb1 rdKyWeJg0al9eRWJT9xQxnBmPlGAj5l/C9NUk70WYWaer5r7xmhmVZhyazIAwf/I pz3huGDWEr7XEt7Nf6+3Xoyq4+koI9RnJtO3Hn5wYzQC/Xn6+JA1qcD1krJoLA2F fockSGh2BA7UtVXx+krv3tnC9xmayLJCxuFBYjzcoWFmzsJoXpgaQ2wR77qXtwnB SUbw55OBbOR2TCXmJajNIDhKc9WvqV46uFd15/Sq8S+xhyU5pkeZM/uK7QBxUT6j Wrb0iPLE6R5KOhDiE+TqfFfaUxMS9zi1sS4eu+KyZ7bQ42CN70SGH/1UDmwAk3x6 rWtTna5azpbJbQO7y4TtOS1/7ieCXwFBbGESqJCOACdBWHNKCmoA4Krc1p16l3+k Qapw/TfC17dcL5X9rynQ238Hvvgwmu6tRFIQFonQVRaaKY9LeFk= =OUMI -----END PGP SIGNATURE----- --ciKbitYsLUhZP3Im--