linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Ocassional dropping of uevent of loop device (possible race)
@ 2020-10-27 18:49 Petr Vorel
  2020-10-27 19:25 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Vorel @ 2020-10-27 18:49 UTC (permalink / raw)
  To: linux-block
  Cc: Martijn Coenen, Christoph Hellwig, Jens Axboe, ltp, Cyril Hrubis

Hi

commit 716ad0986cbd ("loop: Switch to set_capacity_revalidate_and_notify()")
from v5.8-rc1 caused occasional dropping of uevent of attached or detached loop
device (not sure which one). The only difference is that
set_capacity_revalidate_and_notify() has condition:
if (capacity != size && capacity != 0 && size != 0)
thus notification is not triggered here but in a different part of code.

It was found with LTP test uevent01 [1]:

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

It looks to be a race. Usually ~ 10 loops is enough.

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Ocassional dropping of uevent of loop device (possible race)
  2020-10-27 18:49 Ocassional dropping of uevent of loop device (possible race) Petr Vorel
@ 2020-10-27 19:25 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2020-10-27 19:25 UTC (permalink / raw)
  To: Petr Vorel
  Cc: linux-block, Martijn Coenen, Christoph Hellwig, Jens Axboe, ltp

Hi!
> commit 716ad0986cbd ("loop: Switch to set_capacity_revalidate_and_notify()")
> from v5.8-rc1 caused occasional dropping of uevent of attached or detached loop
> device (not sure which one). The only difference is that
> set_capacity_revalidate_and_notify() has condition:
> if (capacity != size && capacity != 0 && size != 0)
> thus notification is not triggered here but in a different part of code.
> 
> It was found with LTP test uevent01 [1]:
> 
> # i=0; while true; do i=$((i+1)); echo "== $i =="; rmmod -f loop; ./uevent01 || break; done
> 
> It looks to be a race. Usually ~ 10 loops is enough.

Looks like the link to test source is missing and should have been:

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

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-27 19:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27 18:49 Ocassional dropping of uevent of loop device (possible race) Petr Vorel
2020-10-27 19:25 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).