summaryrefslogtreecommitdiff
path: root/block/blk-sysfs.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2015-12-03 20:32:33 +0300
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2015-12-03 20:32:33 +0300
commitbe9e2f775f5a3147205c552534c3abf0f9374a13 (patch)
tree9c10584796d73f80295d9c238a089f12621db316 /block/blk-sysfs.c
parente619e6cbecb7fe97a924d625e848605333457b13 (diff)
parent3ddda3e4c82dea58933bde8d0f6ef34470c360cb (diff)
downloadlinux-be9e2f775f5a3147205c552534c3abf0f9374a13.tar.xz
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;