Skip to content

Commit 09c57a7

Browse files
committed
Merge tag 'block-6.7-2023-12-29' of git://git.kernel.dk/linux
Pull block fixes from Jens Axboe: "Fix for a badly numbered flag, and a regression fix for the badblocks updates from this merge window" * tag 'block-6.7-2023-12-29' of git://git.kernel.dk/linux: block: renumber QUEUE_FLAG_HW_WC badblocks: avoid checking invalid range in badblocks_check()
2 parents 8735c7c + 02d374f commit 09c57a7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

block/badblocks.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,12 +1312,14 @@ static int _badblocks_check(struct badblocks *bb, sector_t s, int sectors,
13121312
prev = prev_badblocks(bb, &bad, hint);
13131313

13141314
/* start after all badblocks */
1315-
if ((prev + 1) >= bb->count && !overlap_front(bb, prev, &bad)) {
1315+
if ((prev >= 0) &&
1316+
((prev + 1) >= bb->count) && !overlap_front(bb, prev, &bad)) {
13161317
len = sectors;
13171318
goto update_sectors;
13181319
}
13191320

1320-
if (overlap_front(bb, prev, &bad)) {
1321+
/* Overlapped with front badblocks record */
1322+
if ((prev >= 0) && overlap_front(bb, prev, &bad)) {
13211323
if (BB_ACK(p[prev]))
13221324
acked_badblocks++;
13231325
else

include/linux/blkdev.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ struct request_queue {
538538
#define QUEUE_FLAG_ADD_RANDOM 10 /* Contributes to random pool */
539539
#define QUEUE_FLAG_SYNCHRONOUS 11 /* always completes in submit context */
540540
#define QUEUE_FLAG_SAME_FORCE 12 /* force complete on same CPU */
541-
#define QUEUE_FLAG_HW_WC 18 /* Write back caching supported */
541+
#define QUEUE_FLAG_HW_WC 13 /* Write back caching supported */
542542
#define QUEUE_FLAG_INIT_DONE 14 /* queue is initialized */
543543
#define QUEUE_FLAG_STABLE_WRITES 15 /* don't modify blks until WB is done */
544544
#define QUEUE_FLAG_POLL 16 /* IO polling enabled if set */

0 commit comments

Comments
 (0)