block: fix logging on capacity change
PATCH 1/1 block: fix logging on capacity change
Local variable of 'capacity' stores the previous disk capacity, and 'size' variable records the latest disk capacity, so swap them for fixing logging on capacity change.
Cc Christoph Hellwig <[email protected]>
Fixes a782483cc1f8 ("block: remove the nr_sects field in struct hd_struct")
Signed-off-by Ming Lei <[email protected]>
--- block/genhd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/genhd.c +1 -1
@@ -74,7 +74,7 @@ bool set_capacity_and_notify(struct gendisk *disk, sector_t size)return false;pr_info ("%s: detected capacity change from %lld to %lld\n" , - disk->disk_name, size, capacity); + disk->disk_name, capacity, size);/* * Historically we did not send a uevent for changes to/from an empty
Signature · 1 line
2.29.2
Quoted 3 lines · Ming Lei
Local variable of 'capacity' stores the previous disk capacity, and 'size' variable records the latest disk capacity, so swap them for fixing logging on capacity change.
Ok, looks like we're racing for fixes a lot lately. I have the same fix commited locally since this morning..
Looks good:
Reviewed-by Christoph Hellwig <[email protected]>
Quoted 3 lines · Ming Lei
Local variable of 'capacity' stores the previous disk capacity, and 'size' variable records the latest disk capacity, so swap them for fixing logging on capacity change.
Applied, thanks.
Signature · 1 line
Jens Axboe