This fixes up a couple places where iprutils was not
setting the data direction to SG_DXFER_NONE for SG_IO
ioctls with a zero data length. The sg driver has recently
gotten more strick about this and has started failing
these requests.

Signed-off-by: Brian King <brk...@linux.vnet.ibm.com>
---

 iprlib.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -puN iprlib.c~iprutils_fix_tur iprlib.c
--- iprutils.patches/iprlib.c~iprutils_fix_tur  2017-06-09 11:12:59.427503169 
-0500
+++ iprutils.patches-bjking1/iprlib.c   2017-06-09 11:16:01.653567807 -0500
@@ -3486,7 +3486,7 @@ static int ipr_start_stop(struct ipr_dev
        cdb[4] = start;
 
        rc = sg_ioctl(fd, cdb, NULL,
-                     0, SG_DXFER_FROM_DEV,
+                     0, SG_DXFER_NONE,
                      &sense_data, IPR_INTERNAL_DEV_TIMEOUT);
 
        if (rc != 0)
@@ -3675,7 +3675,7 @@ int __ipr_test_unit_ready(struct ipr_dev
 {
        int fd, rc;
        u8 cdb[IPR_CCB_CDB_LEN];
-       int length = 0, allow_restart = 0;
+       int allow_restart = 0;
        char *name = dev->gen_name;
 
        if (strlen(name) == 0)
@@ -3693,7 +3693,7 @@ int __ipr_test_unit_ready(struct ipr_dev
        cdb[0] = TEST_UNIT_READY;
 
        rc = sg_ioctl(fd, cdb, NULL,
-                     length, SG_DXFER_FROM_DEV,
+                     0, SG_DXFER_NONE,
                      sense_data, IPR_INTERNAL_DEV_TIMEOUT);
 
        close(fd);
_


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iprdd-devel mailing list
Iprdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iprdd-devel

Reply via email to