Initializing the residual length to proper value for BSG requests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

While testing the CT pass thru with BSG, I am seeing that residual length for bi-directional request are not getting set properly (rq- >next_rq->resid_len is not getting set with proper value). I am using scsi-post-merge tree( http://www.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-post-merge-2.6.git) . I do see that req->resid_len getting set whenever a request is fetched from the block layer. I don't see a similar code for bi- directional request. This code below sets the residual length for bi- directional command. Hope this is a proper place to initialize the residual length. Do any body see any side effects because of this change.


diff --git a/block/bsg.c b/block/bsg.c
index 2d746e3..2cffacb 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -281,12 +281,16 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm,
                }
                rq->next_rq = next_rq;
                next_rq->cmd_type = rq->cmd_type;

                dxferp = (void*)(unsigned long)hdr->din_xferp;
                ret =  blk_rq_map_user(q, next_rq, NULL, dxferp,
                                       hdr->din_xfer_len, GFP_KERNEL);
                if (ret)
                        goto out;
+               rq->next_rq->resid_len = blk_rq_bytes(rq->next_rq);

        }

Thanks,
Giridhar.M.B

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux