Skip to contentSkip to conversation

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

PATCH Applied Eric Biggers 3 participants 3 messages Dec 2, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

From: Eric Biggers <[email protected]>

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")
---
 fs/block_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/block_dev.c +1 -1
index ee63c2732fa295..69bf2fb6f7cda0 100644
@@ -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.
Signature · 1 line
2.24.0.393.g34dc348eaf-goog
maintainer Applied
#2 lore raw
In reply to Eric Biggers
Quoted 10 lines · Eric Biggers

From: Eric Biggers <[email protected]>

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.

Applied, thanks.

Signature · 1 line
Jens Axboe