aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/osd/osd_initiator.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
index c98153bfb36..ba2ebae305c 100644
--- a/drivers/scsi/osd/osd_initiator.c
+++ b/drivers/scsi/osd/osd_initiator.c
@@ -1262,7 +1262,7 @@ static inline void osd_sec_parms_set_in_offset(bool is_v1,
1262} 1262}
1263 1263
1264static int _osd_req_finalize_data_integrity(struct osd_request *or, 1264static int _osd_req_finalize_data_integrity(struct osd_request *or,
1265 bool has_in, bool has_out, const u8 *cap_key) 1265 bool has_in, bool has_out, u64 out_data_bytes, const u8 *cap_key)
1266{ 1266{
1267 struct osd_security_parameters *sec_parms = _osd_req_sec_params(or); 1267 struct osd_security_parameters *sec_parms = _osd_req_sec_params(or);
1268 int ret; 1268 int ret;
@@ -1277,8 +1277,7 @@ static int _osd_req_finalize_data_integrity(struct osd_request *or,
1277 }; 1277 };
1278 unsigned pad; 1278 unsigned pad;
1279 1279
1280 or->out_data_integ.data_bytes = cpu_to_be64( 1280 or->out_data_integ.data_bytes = cpu_to_be64(out_data_bytes);
1281 or->out.bio ? or->out.bio->bi_size : 0);
1282 or->out_data_integ.set_attributes_bytes = cpu_to_be64( 1281 or->out_data_integ.set_attributes_bytes = cpu_to_be64(
1283 or->set_attr.total_bytes); 1282 or->set_attr.total_bytes);
1284 or->out_data_integ.get_attributes_bytes = cpu_to_be64( 1283 or->out_data_integ.get_attributes_bytes = cpu_to_be64(
@@ -1370,6 +1369,7 @@ int osd_finalize_request(struct osd_request *or,
1370{ 1369{
1371 struct osd_cdb_head *cdbh = osd_cdb_head(&or->cdb); 1370 struct osd_cdb_head *cdbh = osd_cdb_head(&or->cdb);
1372 bool has_in, has_out; 1371 bool has_in, has_out;
1372 u64 out_data_bytes = or->out.total_bytes;
1373 int ret; 1373 int ret;
1374 1374
1375 if (options & OSD_REQ_FUA) 1375 if (options & OSD_REQ_FUA)
@@ -1439,7 +1439,8 @@ int osd_finalize_request(struct osd_request *or,
1439 } 1439 }
1440 } 1440 }
1441 1441
1442 ret = _osd_req_finalize_data_integrity(or, has_in, has_out, cap_key); 1442 ret = _osd_req_finalize_data_integrity(or, has_in, has_out,
1443 out_data_bytes, cap_key);
1443 if (ret) 1444 if (ret)
1444 return ret; 1445 return ret;
1445 1446