mirror of
https://github.com/torvalds/linux.git
synced 2024-12-01 00:21:32 +00:00
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>
This commit is contained in:
parent
67f455486d
commit
8b32bf5e37
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user