diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/ll_rw_blk.c | 2 | ||||
-rw-r--r-- | block/scsi_ioctl.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 123003a90477..5873861e1dbb 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -1925,6 +1925,8 @@ blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id) | |||
1925 | blk_queue_max_hw_segments(q, MAX_HW_SEGMENTS); | 1925 | blk_queue_max_hw_segments(q, MAX_HW_SEGMENTS); |
1926 | blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS); | 1926 | blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS); |
1927 | 1927 | ||
1928 | q->sg_reserved_size = INT_MAX; | ||
1929 | |||
1928 | /* | 1930 | /* |
1929 | * all done | 1931 | * all done |
1930 | */ | 1932 | */ |
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index 65c6a3cba6d6..e83f1dbf7c29 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c | |||
@@ -78,7 +78,9 @@ static int sg_set_timeout(request_queue_t *q, int __user *p) | |||
78 | 78 | ||
79 | static int sg_get_reserved_size(request_queue_t *q, int __user *p) | 79 | static int sg_get_reserved_size(request_queue_t *q, int __user *p) |
80 | { | 80 | { |
81 | return put_user(q->sg_reserved_size, p); | 81 | unsigned val = min(q->sg_reserved_size, q->max_sectors << 9); |
82 | |||
83 | return put_user(val, p); | ||
82 | } | 84 | } |
83 | 85 | ||
84 | static int sg_set_reserved_size(request_queue_t *q, int __user *p) | 86 | static int sg_set_reserved_size(request_queue_t *q, int __user *p) |