From: Nate Dailey <nate.dailey@stratus.com>
To: linux-raid@vger.kernel.org
Subject: [md PATCH] md/raid1: round up to bdev_logical_block_size in narrow_write_error
Date: Thu, 12 Feb 2015 12:02:09 -0500 [thread overview]
Message-ID: <54DCDC91.6010808@stratus.com> (raw)
This modifies raid1's narrow_write_error to round up block_sectors to the
device's logical block size.
This prevents sd complaining about "Bad block number requested" for non-512-byte
sector disks.
Signed-off-by: Nate Dailey <nate.dailey@stratus.com>
---
diff -Nupr a/drivers/md/raid1.c b/drivers/md/raid1.c
--- a/drivers/md/raid1.c 2015-02-10 15:29:02.000000000 -0500
+++ b/drivers/md/raid1.c 2015-02-10 15:29:45.000000000 -0500
@@ -2206,7 +2206,8 @@ static int narrow_write_error(struct r1b
if (rdev->badblocks.shift < 0)
return 0;
- block_sectors = 1 << rdev->badblocks.shift;
+ block_sectors = roundup(1 << rdev->badblocks.shift,
+ bdev_logical_block_size(rdev->bdev) >> 9);
sector = r1_bio->sector;
sectors = ((sector + block_sectors)
& ~(sector_t)(block_sectors - 1))
next reply other threads:[~2015-02-12 17:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-12 17:02 Nate Dailey [this message]
2015-02-16 3:54 ` [md PATCH] md/raid1: round up to bdev_logical_block_size in narrow_write_error NeilBrown
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=54DCDC91.6010808@stratus.com \
--to=nate.dailey@stratus.com \
--cc=linux-raid@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 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.