Skip to contentSkip to conversation

target/core: Make compare_and_write_callback() accept NULL as third argument

PATCH In review Bart Van Assche 3 participants 4 messages Sep 17, 2018 – Oct 12, 2018 SCSI target

lore
Share & tools
lore
#0 lore raw

PATCH 8/17 target/core: Make compare_and_write_callback() accept NULL as third argument

This patch does not change any functionality. A later patch in this series, namely "Make ABORT and LUN RESET handling synchronous", depends on this patch.

Cc Nicholas Bellinger <[email protected]>
Cc Mike Christie <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Hannes Reinecke <[email protected]>
---
 drivers/target/target_core_sbc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/target/target_core_sbc.c +2 -1
index 689ba6da9a0f..4719e6a98430 100644
@@ -482,7 +482,8 @@ static sense_reason_t compare_and_write_callback(struct se_cmd *cmd, bool succes
 	if (cmd->scsi_status) {
 		pr_debug("compare_and_write_callback: non zero scsi_status:"
 			" 0x%02x\n", cmd->scsi_status);
-		*post_ret = 1;
+		if (post_ret)
+			*post_ret = 1;
 		if (cmd->scsi_status = SAM_STAT_CHECK_CONDITION)
 			ret = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
 		goto out;
Signature · 1 line
2.18.0
#1 lore raw
Quoted 3 lines · Bart Van Assche

This patch does not change any functionality. A later patch in this series, namely "Make ABORT and LUN RESET handling synchronous", depends on this patch.

I'd be tempted to just merge it into that patch to make that fact more obvious.

#2 lore raw
In reply to Bart Van Assche
Quoted 18 lines · Bart Van Assche

This patch does not change any functionality. A later patch in this series, namely "Make ABORT and LUN RESET handling synchronous", depends on this patch.

Cc Nicholas Bellinger <[email protected]>
Cc Mike Christie <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Hannes Reinecke <[email protected]>
---
 drivers/target/target_core_sbc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/target/target_core_sbc.c +0 -0
index 689ba6da9a0f..4719e6a98430 100644

drivers/target/target_core_sbc.c static sense_reason_t compare_and_write_callback(struct se_cmd *cmd, bool succes · line 489

Quoted 9 lines
drivers/target/target_core_sbc.c +2 -1
@@ -482,7 +482,8 @@ static sense_reason_t compare_and_write_callback(struct se_cmd *cmd, bool succes
 	if (cmd->scsi_status) {
 		pr_debug("compare_and_write_callback: non zero scsi_status:"
 			" 0x%02x\n", cmd->scsi_status);
-		*post_ret = 1;
+		if (post_ret)
+			*post_ret = 1;
 		if (cmd->scsi_status = SAM_STAT_CHECK_CONDITION)
 			ret = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
 		goto out;

Looks fine, but should be folded into patch #9 since it's the one who is first passing a NULL in *post_ret transport_generic_request_failure().

#3 lore raw
In reply to Bart Van Assche

On Sat, 2018-10-06 at 14:07 +-0200, Christoph Hellwig wrote:
+AD4 On Mon, Sep 17, 2018 at 02:35:45PM -0700, Bart Van Assche wrote:
+AD4 +AD4 This patch does not change any functionality. A later patch in this series, +AD4 +AD4 namely +ACI-Make ABORT and LUN RESET handling synchronous+ACI, depends on this +AD4 +AD4 patch.
+AD4
+AD4 I'd be tempted to just merge it into that patch to make that fact more +AD4 obvious.

OK, I will do that.

Thanks,

Bart.