From: Eric Biggers Date: Mon, 2 Dec 2019 18:21:34 +0000 (-0800) Subject: block: don't send uevent for empty disk when not invalidating X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=490547ca2df66b8413bce97cb651630f2c531487;p=linux.git block: don't send uevent for empty disk when not invalidating Commit 6917d0689993 ("block: merge invalidate_partitions into rescan_partitions") caused a regression where systemd-udevd spins forever using max CPU starting at boot time. It's caused by a behavior change where a KOBJ_CHANGE uevent is now sent in a case where previously it wasn't. Restore the old behavior. Fixes: 6917d0689993 ("block: merge invalidate_partitions into rescan_partitions") Reviewed-by: Christoph Hellwig Signed-off-by: Eric Biggers Signed-off-by: Jens Axboe --- diff --git a/fs/block_dev.c b/fs/block_dev.c index ee63c2732fa29..69bf2fb6f7cda 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -1531,7 +1531,7 @@ rescan: ret = blk_add_partitions(disk, bdev); if (ret == -EAGAIN) goto rescan; - } else { + } else if (invalidate) { /* * Tell userspace that the media / partition table may have * changed.