From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Christoph Hellwig <hch@lst.de>, "axboe@kernel.dk" <axboe@kernel.dk>
Cc: "hi@alyssa.is" <hi@alyssa.is>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH] loop: LOOP_CONFIGURE: send uevents for partitions
Date: Sun, 26 Mar 2023 23:09:12 +0000 [thread overview]
Message-ID: <21c2861f-9b7d-636e-74e1-27bd7bbb1a4f@nvidia.com> (raw)
In-Reply-To: <20230320125430.55367-1-hch@lst.de>
Alyssa,
On 3/20/23 05:54, Christoph Hellwig wrote:
> From: Alyssa Ross <hi@alyssa.is>
>
> LOOP_CONFIGURE is, as far as I understand it, supposed to be a way to
> combine LOOP_SET_FD and LOOP_SET_STATUS64 into a single syscall. When
> using LOOP_SET_FD+LOOP_SET_STATUS64, a single uevent would be sent for
> each partition found on the loop device after the second ioctl(), but
> when using LOOP_CONFIGURE, no such uevent was being sent.
>
> In the old setup, uevents are disabled for LOOP_SET_FD, but not for
> LOOP_SET_STATUS64. This makes sense, as it prevents uevents being
> sent for a partially configured device during LOOP_SET_FD - they're
> only sent at the end of LOOP_SET_STATUS64. But for LOOP_CONFIGURE,
> uevents were disabled for the entire operation, so that final
> notification was never issued. To fix this, reduce the critical
> section to exclude the loop_reread_partitions() call, which causes
> the uevents to be issued, to after uevents are re-enabled, matching
> the behaviour of the LOOP_SET_FD+LOOP_SET_STATUS64 combination.
>
> I noticed this because Busybox's losetup program recently changed from
> using LOOP_SET_FD+LOOP_SET_STATUS64 to LOOP_CONFIGURE, and this broke
> my setup, for which I want a notification from the kernel any time a
> new partition becomes available.
>
> Signed-off-by: Alyssa Ross <hi@alyssa.is>
> [hch: reduced the critical section]
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Fixes: 3448914e8cc5 ("loop: Add LOOP_CONFIGURE ioctl")
>
Can you please add the testcase in the blktests to test the
above mentioned behavior ?
-ck
next prev parent reply other threads:[~2023-03-26 23:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-20 12:54 [PATCH] loop: LOOP_CONFIGURE: send uevents for partitions Christoph Hellwig
2023-03-26 23:09 ` Chaitanya Kulkarni [this message]
2023-03-30 16:02 ` [PATCH blktests] loop/009: add test for loop partition uvents Alyssa Ross
2023-03-30 19:22 ` kernel test robot
2023-03-30 19:50 ` LKP kernel test robot and blktests patches Alyssa Ross
2023-03-31 15:26 ` Yujie Liu
2023-04-04 18:29 ` [PATCH blktests] loop/009: add test for loop partition uvents Chaitanya Kulkarni
2023-04-04 18:45 ` Alyssa Ross
2023-04-06 10:30 ` Shin'ichiro Kawasaki
2023-05-22 2:29 ` Shinichiro Kawasaki
2023-03-29 15:24 ` [PATCH] loop: LOOP_CONFIGURE: send uevents for partitions Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=21c2861f-9b7d-636e-74e1-27bd7bbb1a4f@nvidia.com \
--to=chaitanyak@nvidia.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=hi@alyssa.is \
--cc=linux-block@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox