Message ID | 20231223063728.3229446-5-linan666@huaweicloud.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | badblocks: bugfix and cleanup of _badblocks_check() | expand |
diff --git a/block/badblocks.c b/block/badblocks.c index 71a3e43351da..88ed13897443 100644 --- a/block/badblocks.c +++ b/block/badblocks.c @@ -486,7 +486,7 @@ static int prev_badblocks(struct badblocks *bb, struct badblocks_context *bad, int lo, hi; u64 *p; - if (!bb->count) + if (badblocks_empty(bb)) goto out; if (hint >= 0) { @@ -521,8 +521,7 @@ static int prev_badblocks(struct badblocks *bb, struct badblocks_context *bad, hi = mid; } - if (BB_OFFSET(p[lo]) <= s) - ret = lo; + ret = lo; out: return ret; }