Skip to content

Commit

Permalink
block: don't send uevent for empty disk when not invalidating
Browse files Browse the repository at this point in the history
Commit 6917d06 ("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: 6917d06 ("block: merge invalidate_partitions into rescan_partitions")
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
ebiggers authored and axboe committed Dec 3, 2019
1 parent 441cdbd commit 490547c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ int bdev_disk_changed(struct block_device *bdev, bool invalidate)
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.
Expand Down

0 comments on commit 490547c

Please sign in to comment.