]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
block: don't send uevent for empty disk when not invalidating
authorEric Biggers <ebiggers@google.com>
Mon, 2 Dec 2019 18:21:34 +0000 (10:21 -0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 3 Dec 2019 01:49:30 +0000 (18:49 -0700)
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 <hch@lst.de>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/block_dev.c

index ee63c2732fa2958f28de26f9c100602bb99fe1d2..69bf2fb6f7cda08264aba5549c2301d36fdfd74d 100644 (file)
@@ -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.