Skip to content

Commit 85f7292

Browse files
Anuj Guptaaxboe
authored andcommitted
block: Correctly initialize BLK_INTEGRITY_NOGENERATE and BLK_INTEGRITY_NOVERIFY
Currently, BLK_INTEGRITY_NOGENERATE and BLK_INTEGRITY_NOVERIFY are not explicitly set during integrity initialization. This can lead to incorrect reporting of read_verify and write_generate sysfs values, particularly when a device does not support integrity. Ensure that these flags are correctly initialized by default. Reported-by: M Nikhil <[email protected]> Link: https://lore.kernel.org/linux-block/[email protected]/ Fixes: 9f4aa46 ("block: invert the BLK_INTEGRITY_{GENERATE,VERIFY} flags") Signed-off-by: Anuj Gupta <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 677e332 commit 85f7292

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

block/blk-settings.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ static int blk_validate_integrity_limits(struct queue_limits *lim)
114114
pr_warn("invalid PI settings.\n");
115115
return -EINVAL;
116116
}
117+
bi->flags |= BLK_INTEGRITY_NOGENERATE | BLK_INTEGRITY_NOVERIFY;
117118
return 0;
118119
}
119120

0 commit comments

Comments
 (0)