Skip to contentSkip to conversation

bsg: Remove bogus check against request_queue->max_sectors

PATCH RESEND Applied Boaz Harrosh 2 participants 2 messages Mar 19, 2009 – Mar 24, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 bsg: Remove bogus check against request_queue->max_sectors

bsg submits REQ_TYPE_BLOCK_PC so the right check is max_hw_sectors. But I've removed this check because right after, bsg proceeds with calling blk_rq_map_user() which does all the right checks.

---
 block/bsg.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
block/bsg.c +0 -3
index 0ce8806..44a2a0f 100644
@@ -218,9 +218,6 @@ bsg_validate_sgv4_hdr(struct request_queue *q, struct sg_io_v4 *hdr, int *rw)
 
 	if (hdr->guard != 'Q')
 		return -EINVAL;
-	if (hdr->dout_xfer_len > (q->max_sectors << 9) ||
-	    hdr->din_xfer_len > (q->max_sectors << 9))
-		return -EIO;
 
 	switch (hdr->protocol) {
 	case BSG_PROTOCOL_SCSI:
Signature · 1 line
1.6.2.1
Applied
#1 lore raw
Quoted 15 lines · Boaz Harrosh

bsg submits REQ_TYPE_BLOCK_PC so the right check is max_hw_sectors. But I've removed this check because right after, bsg proceeds with calling blk_rq_map_user() which does all the right checks.

---
 block/bsg.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
block/bsg.c +0 -0
index 0ce8806..44a2a0f 100644

block/bsg.c bsg_validate_sgv4_hdr(struct request_queue *q, struct sg_io_v4 *hdr, int *rw) · line 223

Quoted 9 lines
block/bsg.c +0 -3
@@ -218,9 +218,6 @@ bsg_validate_sgv4_hdr(struct request_queue *q, struct sg_io_v4 *hdr, int *rw)
 
 	if (hdr->guard != 'Q')
 		return -EINVAL;
-	if (hdr->dout_xfer_len > (q->max_sectors << 9) ||
-	    hdr->din_xfer_len > (q->max_sectors << 9))
-		return -EIO;
 
 	switch (hdr->protocol) {
 	case BSG_PROTOCOL_SCSI:

Applied

Signature · 1 line
Jens Axboe