Linux block layer
 help / color / mirror / Atom feed
* [PATCH] block: don't send uevent for empty disk when not invalidating
@ 2019-12-02 18:21 Eric Biggers
  2019-12-02 18:23 ` Christoph Hellwig
  2019-12-02 18:46 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Biggers @ 2019-12-02 18:21 UTC (permalink / raw)
  To: linux-block, Jens Axboe; +Cc: Christoph Hellwig, Jan Kara

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(-)

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.
-- 
2.24.0.393.g34dc348eaf-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-02 18:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-02 18:21 [PATCH] block: don't send uevent for empty disk when not invalidating Eric Biggers
2019-12-02 18:23 ` Christoph Hellwig
2019-12-02 18:46 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox