summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorEric Wheeler <git@linux.ewheeler.net>2016-08-19 06:15:26 +0300
committerEric Wheeler <git@linux.ewheeler.net>2016-08-19 06:31:03 +0300
commit90706094d5be614ae7285b3c96c3125bb198618c (patch)
tree8eb365d5bbb95058e0180dbb1a819dc965b74103 /drivers
parentacc9cf8c66c66b2cbbdb4a375537edee72be64df (diff)
downloadlinux-90706094d5be614ae7285b3c96c3125bb198618c.tar.xz
bcache: pr_err: more meaningful error message when nr_stripes is invalid
The original error was thought to be corruption, but was actually caused by: make-bcache --data-offset N where N was in bytes and should have been in sectors. While userspace tools should be updated to check --data-offset beyond end of volume, hopefully this will help others that might not have noticed the units. Signed-off-by: Eric Wheeler <bcache@linux.ewheeler.net> Cc: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/bcache/super.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 6b93e1b77767..849ad441cd76 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -760,7 +760,8 @@ static int bcache_device_init(struct bcache_device *d, unsigned block_size,
if (!d->nr_stripes ||
d->nr_stripes > INT_MAX ||
d->nr_stripes > SIZE_MAX / sizeof(atomic_t)) {
- pr_err("nr_stripes too large");
+ pr_err("nr_stripes too large or invalid: %u (start sector beyond end of disk?)",
+ (unsigned)d->nr_stripes);
return -ENOMEM;
}