Message ID | 20250227075507.151331-9-zhengqixing@huaweicloud.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | badblocks: bugfix and cleanup for badblocks | expand |
diff --git a/block/badblocks.c b/block/badblocks.c index 57e9edf9b848..92bd43f7fff1 100644 --- a/block/badblocks.c +++ b/block/badblocks.c @@ -892,7 +892,7 @@ static int _badblocks_set(struct badblocks *bb, sector_t s, int sectors, len = insert_at(bb, 0, &bad); bb->count++; added++; - hint = 0; + hint = ++prev; goto update_sectors; } @@ -947,7 +947,7 @@ static int _badblocks_set(struct badblocks *bb, sector_t s, int sectors, len = insert_at(bb, prev + 1, &bad); bb->count++; added++; - hint = prev + 1; + hint = ++prev; update_sectors: s += len;