diff options
author | Matteo Croce <mcroce@microsoft.com> | 2021-07-13 01:05:30 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-08-02 21:37:29 +0200 |
commit | 9f65c489b68d42427dc0651488dd260d678f525d (patch) | |
tree | a6b1cd7f02596190763931d26943b8a5c434de54 /block/blk-mq-sysfs.c | |
parent | block: add a helper to raise a media changed event (diff) | |
download | linux-9f65c489b68d42427dc0651488dd260d678f525d.tar.xz linux-9f65c489b68d42427dc0651488dd260d678f525d.zip |
loop: raise media_change event
Make the loop device raise a DISK_MEDIA_CHANGE event on attach or detach.
# udevadm monitor -up |grep -e DISK_MEDIA_CHANGE -e DEVNAME &
# losetup -f zero
[ 7.454235] loop0: detected capacity change from 0 to 16384
DISK_MEDIA_CHANGE=1
DEVNAME=/dev/loop0
DEVNAME=/dev/loop0
DEVNAME=/dev/loop0
# losetup -f zero
[ 10.205245] loop1: detected capacity change from 0 to 16384
DISK_MEDIA_CHANGE=1
DEVNAME=/dev/loop1
DEVNAME=/dev/loop1
DEVNAME=/dev/loop1
# losetup -f zero2
[ 13.532368] loop2: detected capacity change from 0 to 40960
DISK_MEDIA_CHANGE=1
DEVNAME=/dev/loop2
DEVNAME=/dev/loop2
# losetup -D
DEVNAME=/dev/loop1
DISK_MEDIA_CHANGE=1
DEVNAME=/dev/loop1
DEVNAME=/dev/loop2
DISK_MEDIA_CHANGE=1
DEVNAME=/dev/loop2
DEVNAME=/dev/loop0
DISK_MEDIA_CHANGE=1
DEVNAME=/dev/loop0
Signed-off-by: Matteo Croce <mcroce@microsoft.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Luca Boccassi <bluca@debian.org>
Link: https://lore.kernel.org/r/20210712230530.29323-7-mcroce@linux.microsoft.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq-sysfs.c')
0 files changed, 0 insertions, 0 deletions