Skip to content

Commit

Permalink
block: fix logging on capacity change
Browse files Browse the repository at this point in the history
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: a782483 ("block: remove the nr_sects field in struct hd_struct")
Signed-off-by: Ming Lei <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Ming Lei authored and axboe committed Feb 24, 2021
1 parent 97f433c commit 452c0bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 452c0bf

Please sign in to comment.