All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: fix logging on capacity change
@ 2021-02-23  8:50 Ming Lei
  2021-02-23 14:50 ` Christoph Hellwig
  2021-02-24  2:29 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Ming Lei @ 2021-02-23  8:50 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Ming Lei, Christoph Hellwig

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>
---
 block/genhd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/genhd.c b/block/genhd.c
index 36ff45bbaaaf..dbb92e24ef65 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
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] block: fix logging on capacity change
  2021-02-23  8:50 [PATCH] block: fix logging on capacity change Ming Lei
@ 2021-02-23 14:50 ` Christoph Hellwig
  2021-02-24  2:29 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2021-02-23 14:50 UTC (permalink / raw)
  To: Ming Lei; +Cc: Jens Axboe, linux-block, Christoph Hellwig

On Tue, Feb 23, 2021 at 04:50:15PM +0800, Ming Lei wrote:
> 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 <hch@lst.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] block: fix logging on capacity change
  2021-02-23  8:50 [PATCH] block: fix logging on capacity change Ming Lei
  2021-02-23 14:50 ` Christoph Hellwig
@ 2021-02-24  2:29 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2021-02-24  2:29 UTC (permalink / raw)
  To: Ming Lei; +Cc: linux-block, Christoph Hellwig

On 2/23/21 1:50 AM, Ming Lei wrote:
> 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.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-24  2:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23  8:50 [PATCH] block: fix logging on capacity change Ming Lei
2021-02-23 14:50 ` Christoph Hellwig
2021-02-24  2:29 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.