On Tue, Oct 24, 2023 at 12:06:26AM -0700, Christoph Hellwig wrote: > On Mon, Oct 23, 2023 at 04:08:21PM +0200, Christian Brauner wrote: > > No you get uevents if you trigger a partition rescan but only if there > > are actually partitions. What you never get however is a media change > > event even though we do increment the disk sequence number and attach an > > image to the loop device. > > > > This seems problematic because we leave userspace unable to listen for > > attaching images to a loop device. Shouldn't we regenerate the media > > change event after we're done setting up the device and before the > > partition rescan for LOOP_CONFIGURE? > > Maybe. I think people mostly didn't care about the even anyway, but > about the changing sequence number to check that the content hasn't > changed. Yes, exactly. The core is the changed sequence number but you don't get that notification if you don't have any partitions and you request a partition rescan from LOOP_CONFIGURE. So I think we should always send the media change event for the sequence number independent of the partition notification.