]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
block: fix logging on capacity change
authorMing Lei <ming.lei@redhat.com>
Tue, 23 Feb 2021 08:50:15 +0000 (16:50 +0800)
committerAndrea Righi <andrea.righi@canonical.com>
Mon, 15 Mar 2021 14:09:36 +0000 (15:09 +0100)
[ Upstream commit 452c0bf8754fbeffdf579465b82a3c2bbe373c95 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
block/genhd.c

index 04b117c7edd16e3bd5c7ca2c7083cecc98215a1f..d9ef2633682c29bd5eeac73e40a4d9f7bacd5153 100644 (file)
@@ -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