summaryrefslogtreecommitdiffstats
path: root/block/blk-sysfs.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2015-12-03 18:32:33 +0100
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2015-12-03 18:32:33 +0100
commitbe9e2f775f5a3147205c552534c3abf0f9374a13 (patch)
tree9c10584796d73f80295d9c238a089f12621db316 /block/blk-sysfs.c
parentRevert "scsi: Fix a bdi reregistration race" (diff)
parentmpt3sas: fix Kconfig dependency problem for mpt2sas back compatibility (diff)
downloadlinux-be9e2f775f5a3147205c552534c3abf0f9374a13.tar.xz
linux-be9e2f775f5a3147205c552534c3abf0f9374a13.zip
Merge branch 'mkp-fixes' into fixes
Diffstat (limited to 'block/blk-sysfs.c')
-rw-r--r--block/blk-sysfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 565b8dac5782..e140cc487ce1 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -205,6 +205,9 @@ queue_max_sectors_store(struct request_queue *q, const char *page, size_t count)
if (ret < 0)
return ret;
+ max_hw_sectors_kb = min_not_zero(max_hw_sectors_kb, (unsigned long)
+ q->limits.max_dev_sectors >> 1);
+
if (max_sectors_kb > max_hw_sectors_kb || max_sectors_kb < page_kb)
return -EINVAL;