public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shaohua Li <shli@kernel.org>
To: linux-kernel@vger.kernel.org, axboe@kernel.dk
Subject: [PATCH] null_blk: fix a bug in capacity calculation
Date: Fri, 11 Oct 2013 12:14:28 +0800	[thread overview]
Message-ID: <20131011041428.GB1692@kernel.org> (raw)

the capacity calculation is obvious buggy.

Signed-off-by: Shaohua Li <shli@fusionio.com>
---
 drivers/block/null_blk.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: master/drivers/block/null_blk.c
===================================================================
--- master.orig/drivers/block/null_blk.c	2013-10-11 12:08:49.625163094 +0800
+++ master/drivers/block/null_blk.c	2013-10-11 12:08:49.625163094 +0800
@@ -555,7 +555,7 @@ err:
 	blk_queue_physical_block_size(nullb->q, bs);
 
 	size = gb * 1024 * 1024 * 1024ULL;
-	size = sector_div(size, bs);
+	sector_div(size, bs);
 	set_capacity(disk, size);
 
 	disk->flags |= GENHD_FL_EXT_DEVT;

             reply	other threads:[~2013-10-11  4:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11  4:14 Shaohua Li [this message]
2013-10-11 14:26 ` [PATCH] null_blk: fix a bug in capacity calculation Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131011041428.GB1692@kernel.org \
    --to=shli@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox