]> git.baikalelectronics.ru Git - kernel.git/commit
badblocks: fix overlapping check for clearing
authorTomasz Majchrzak <tomasz.majchrzak@intel.com>
Wed, 12 Oct 2016 10:23:08 +0000 (12:23 +0200)
committerJens Axboe <axboe@fb.com>
Wed, 12 Oct 2016 14:08:08 +0000 (08:08 -0600)
commit50bc695c9cb49aeee7b363eaaba14c97a646a20f
tree41d80d976b3c37fb424d44f25239fbb5c3aa3198
parent76a94c6d097930adfaa61b493b62be996143987b
badblocks: fix overlapping check for clearing

Current bad block clear implementation assumes the range to clear
overlaps with at least one bad block already stored. If given range to
clear precedes first bad block in a list, the first entry is incorrectly
updated.

Check not only if stored block end is past clear block end but also if
stored block start is before clear block end.

Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
Acked-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/badblocks.c