diff options
author | NeilBrown <neilb@suse.de> | 2014-05-28 05:39:22 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2014-05-29 08:59:46 +0200 |
commit | 8b32bf5e37328c0ef267bc95d73b55e52f72ac77 (patch) | |
tree | 6f85ee28bfe2a09652577bf332ea07c01be1361d /drivers/md | |
parent | md/raid56: Don't perform reads to support writes until stripe is ready. (diff) | |
download | linux-8b32bf5e37328c0ef267bc95d73b55e52f72ac77.tar.xz linux-8b32bf5e37328c0ef267bc95d73b55e52f72ac77.zip |
md: md_clear_badblocks should return an error code on failure.
Julia Lawall and coccinelle report that md_clear_badblocks always
returns 0, despite appearing to have an error path.
The error path really should return an error code. ENOSPC is
reasonably appropriate.
Reported-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/md.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 0ddf38988fbc..34846856dbc6 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -8343,7 +8343,7 @@ static int md_clear_badblocks(struct badblocks *bb, sector_t s, int sectors) if (a < s) { /* we need to split this range */ if (bb->count >= MD_MAX_BADBLOCKS) { - rv = 0; + rv = -ENOSPC; goto out; } memmove(p+lo+1, p+lo, (bb->count - lo) * 8); |