summaryrefslogtreecommitdiffstats
path: root/block/genhd.c
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2021-02-23 09:50:15 +0100
committerJens Axboe <axboe@kernel.dk>2021-02-24 03:28:51 +0100
commit452c0bf8754fbeffdf579465b82a3c2bbe373c95 (patch)
tree12f491255956830d0da74318f97fe6b0ebc1a5e0 /block/genhd.c
parentblk-settings: align max_sectors on "logical_block_size" boundary (diff)
downloadlinux-452c0bf8754fbeffdf579465b82a3c2bbe373c95.tar.xz
linux-452c0bf8754fbeffdf579465b82a3c2bbe373c95.zip
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 <hch@lst.de> Fixes: a782483cc1f8 ("block: remove the nr_sects field in struct hd_struct") Signed-off-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/genhd.c')
-rw-r--r--block/genhd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 6379b000576c..fcc530164b5a 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -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