Message ID | 1523566722-24667-1-git-send-email-bryantly@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
The patch looks fine, but in general I think descriptions of what you fixed in the code or more important than starting out with a backtrace. E.g. please explain what was wrong, how you fixed it and only after that mention how it was caught. (preferably without the whole trace)
On 4/13/18 11:44 AM, Christoph Hellwig wrote: > The patch looks fine, but in general I think descriptions of what > you fixed in the code or more important than starting out with > a backtrace. > > E.g. please explain what was wrong, how you fixed it and only after > that mention how it was caught. (preferably without the whole trace) > I will put the trace at the end next time. Do you want me to re-submit with it moved? -Bryant
On Tue, Apr 17, 2018 at 10:18:17AM -0500, Bryant G. Ly wrote: > > On 4/13/18 11:44 AM, Christoph Hellwig wrote: > > > The patch looks fine, but in general I think descriptions of what > > you fixed in the code or more important than starting out with > > a backtrace. > > > > E.g. please explain what was wrong, how you fixed it and only after > > that mention how it was caught. (preferably without the whole trace) > > > I will put the trace at the end next time. Do you want me to re-submit > with it moved? Please do.
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index 07c814c..6042901 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -427,8 +427,8 @@ iblock_execute_zero_out(struct block_device *bdev, struct se_cmd *cmd) { struct se_device *dev = cmd->se_dev; struct scatterlist *sg = &cmd->t_data_sg[0]; - unsigned char *buf, zero = 0x00, *p = &zero; - int rc, ret; + unsigned char *buf, *not_zero; + int ret; buf = kmap(sg_page(sg)) + sg->offset; if (!buf) @@ -437,10 +437,10 @@ iblock_execute_zero_out(struct block_device *bdev, struct se_cmd *cmd) * Fall back to block_execute_write_same() slow-path if * incoming WRITE_SAME payload does not contain zeros. */ - rc = memcmp(buf, p, cmd->data_length); + not_zero = memchr_inv(buf, 0x00, cmd->data_length); kunmap(sg_page(sg)); - if (rc) + if (not_zero) return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; ret = blkdev_issue_zeroout(bdev,