diff mbox series

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

Message ID 20191202182134.4004-1-ebiggers@kernel.org (mailing list archive)
State New, archived
Headers show
Series block: don't send uevent for empty disk when not invalidating | expand

Commit Message

Eric Biggers Dec. 2, 2019, 6:21 p.m. UTC
From: Eric Biggers <ebiggers@google.com>

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")
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 fs/block_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Hellwig Dec. 2, 2019, 6:23 p.m. UTC | #1
Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
Jens Axboe Dec. 2, 2019, 6:46 p.m. UTC | #2
On 12/2/19 10:21 AM, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> 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.
diff mbox series

Patch

diff --git a/fs/block_dev.c b/fs/block_dev.c
index ee63c2732fa295..69bf2fb6f7cda0 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -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.