]> git.baikalelectronics.ru Git - kernel.git/commit
loop: Fix occasional uevent drop
authorPetr Vorel <pvorel@suse.cz>
Thu, 12 Nov 2020 16:50:05 +0000 (17:50 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 12 Nov 2020 20:59:04 +0000 (13:59 -0700)
commit9d851f337044220e97f0be82ddf75f618167ce5c
treec0400539b57e94605378866bddd937385453690f
parent3041795d69254c255bcbf3e3d4ada5648953314f
loop: Fix occasional uevent drop

Commit f0514201a279 ("loop: Switch to set_capacity_revalidate_and_notify")
causes an occasional drop of loop device uevent, which are no longer
triggered in loop_set_size() but in a different part of code.

Bug is reproducible with LTP test uevent01 [1]:

i=0; while true; do
    i=$((i+1)); echo "== $i =="
    lsmod |grep -q loop && rmmod -f loop
    ./uevent01 || break
done

Put back triggering through code called in loop_set_size().

Fix required to add yet another parameter to
set_capacity_revalidate_and_notify().

[1] https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/uevents/uevent01.c

[hch: rebased on a different change to the prototype of
 set_capacity_revalidate_and_notify]

Cc: stable@vger.kernel.org # v5.9
Fixes: f0514201a279 ("loop: Switch to set_capacity_revalidate_and_notify")
Reported-by: <ltp@lists.linux.it>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c