Commit 490547ca authored by Eric Biggers's avatar Eric Biggers Committed by Jens Axboe
Browse files

block: don't send uevent for empty disk when not invalidating



Commit 6917d068 ("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: 6917d068 ("block: merge invalidate_partitions into rescan_partitions")
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 441cdbd5
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1531,7 +1531,7 @@ rescan:
		ret = blk_add_partitions(disk, bdev);
		ret = blk_add_partitions(disk, bdev);
		if (ret == -EAGAIN)
		if (ret == -EAGAIN)
			goto rescan;
			goto rescan;
	} else {
	} else if (invalidate) {
		/*
		/*
		 * Tell userspace that the media / partition table may have
		 * Tell userspace that the media / partition table may have
		 * changed.
		 * changed.