summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorAnuj Gupta <anuj20.g@samsung.com>2025-03-05 12:00:33 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-10 14:44:06 +0200
commite55b0170bde4f5f4d4297160134ee78bec29265f (patch)
tree3d01380f4ac6505140e90716b26af03518fab3f2 /block
parentfb489ec3ab1ad2d36f35465954247e240821a592 (diff)
downloadlinux-e55b0170bde4f5f4d4297160134ee78bec29265f.tar.gz
linux-e55b0170bde4f5f4d4297160134ee78bec29265f.tar.bz2
linux-e55b0170bde4f5f4d4297160134ee78bec29265f.zip
block: Correctly initialize BLK_INTEGRITY_NOGENERATE and BLK_INTEGRITY_NOVERIFY
[ Upstream commit 85f72925000e924291a0ebf63d2234994a4f22bd ] 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 <nikh1092@linux.ibm.com> Link: https://lore.kernel.org/linux-block/f6130475-3ccd-45d2-abde-3ccceada0f0a@linux.ibm.com/ Fixes: 9f4aa46f2a74 ("block: invert the BLK_INTEGRITY_{GENERATE,VERIFY} flags") Signed-off-by: Anuj Gupta <anuj20.g@samsung.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20250305063033.1813-3-anuj20.g@samsung.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'block')
-rw-r--r--block/blk-settings.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/blk-settings.c b/block/blk-settings.c
index 0b0641fa33c0..66721afeea54 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -114,6 +114,7 @@ static int blk_validate_integrity_limits(struct queue_limits *lim)
pr_warn("invalid PI settings.\n");
return -EINVAL;
}
+ bi->flags |= BLK_INTEGRITY_NOGENERATE | BLK_INTEGRITY_NOVERIFY;
return 0;
}