summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_debug.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2013-04-16 15:11:56 +0200
committerJames Bottomley <JBottomley@Parallels.com>2013-05-03 00:39:54 +0200
commitac17078ae6947254331f56ce4f1db9ea221d43d6 (patch)
treee2909e1b328f57de1e2fbd7eb2b47a1723e54bae /drivers/scsi/scsi_debug.c
parent[SCSI] scsi_debug: call map_region() and unmap_region() only when needed (diff)
downloadlinux-ac17078ae6947254331f56ce4f1db9ea221d43d6.tar.xz
linux-ac17078ae6947254331f56ce4f1db9ea221d43d6.zip
[SCSI] scsi_debug: prohibit scsi_debug_unmap_granularity == scsi_debug_unmap_alignment
scsi_debug prohibits setting scsi_debug_unmap_alignment to be greater than scsi_debug_unmap_granularity. But setting them to be the same value is not prohibited. In this case, the only difference with scsi_debug_unmap_alignment == 0 is the logical blocks from 0 to scsi_debug_unmap_alignment - 1 cannot be unmapped. But the difference is not properly handled in the current code. So this prohibits such unusual setting. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
-rw-r--r--drivers/scsi/scsi_debug.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 05abf4e153a3..5c321409fff3 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -3413,9 +3413,10 @@ static int __init scsi_debug_init(void)
clamp(scsi_debug_unmap_granularity, 1U, 0xffffffffU);
if (scsi_debug_unmap_alignment &&
- scsi_debug_unmap_granularity < scsi_debug_unmap_alignment) {
+ scsi_debug_unmap_granularity <=
+ scsi_debug_unmap_alignment) {
printk(KERN_ERR
- "%s: ERR: unmap_granularity < unmap_alignment\n",
+ "%s: ERR: unmap_granularity <= unmap_alignment\n",
__func__);
return -EINVAL;
}