block: warn when putting the final reference on a registered disk
PATCH 1/1 block: warn when putting the final reference on a registered disk
Warn when the last reference on a live disk is put without calling del_gendisk first. There are some BDI related bug reports that look like a case of this, so make sure we have the proper instrumentation to catch it.
Signed-off-by Christoph Hellwig <[email protected]>
--- block/genhd.c | 1 + 1 file changed, 1 insertion(+)
block/genhd.c +1 -0
@@ -1057,6 +1057,7 @@ static void disk_release(struct device *dev)struct gendisk *disk =dev_to_disk (dev);might_sleep (); +WARN_ON_ONCE (disk_live (disk));disk_release_events (disk);kfree (disk->random);
Signature · 1 line
2.30.2
Quoted 6 lines · Christoph Hellwig
Warn when the last reference on a live disk is put without calling
del_gendiskfirst. There are some BDI related bug reports that look like a case of this, so make sure we have the proper instrumentation to catch it.
Applied, thanks!
[1/1] block: warn when putting the final reference on a registered disk
commit: a20417611b98e12a724e5c828c472ea16990b71f
Best regards,
Signature · 1 line
Jens Axboe