[08/17] target/core: Make compare_and_write_callback() accept NULL as third argument
diff mbox series

Message ID 20180917213554.987-9-bvanassche@acm.org
State New, archived
Headers show
Series
  • Make ABORT and LUN RESET handling synchronous
Related show

Commit Message

Bart Van Assche Sept. 17, 2018, 9:35 p.m. UTC
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.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Mike Christie <mchristi@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
---
 drivers/target/target_core_sbc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Christoph Hellwig Oct. 6, 2018, 12:07 p.m. UTC | #1
On Mon, Sep 17, 2018 at 02:35:45PM -0700, Bart Van Assche wrote:
> 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.
Nicholas A. Bellinger Oct. 7, 2018, 1:31 a.m. UTC | #2
On Mon, 2018-09-17 at 14:35 -0700, Bart Van Assche wrote:
> 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.
> 
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> Cc: Nicholas Bellinger <nab@linux-iscsi.org>
> Cc: Mike Christie <mchristi@redhat.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Hannes Reinecke <hare@suse.de>
> ---
>  drivers/target/target_core_sbc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c
> index 689ba6da9a0f..4719e6a98430 100644
> --- a/drivers/target/target_core_sbc.c
> +++ b/drivers/target/target_core_sbc.c
> @@ -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().
Bart Van Assche Oct. 12, 2018, 5:14 p.m. UTC | #3
On Sat, 2018-10-06 at 14:07 +0200, Christoph Hellwig wrote:
> On Mon, Sep 17, 2018 at 02:35:45PM -0700, Bart Van Assche wrote:
> > 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.

OK, I will do that.

Thanks,

Bart.

Patch
diff mbox series

diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c
index 689ba6da9a0f..4719e6a98430 100644
--- a/drivers/target/target_core_sbc.c
+++ b/drivers/target/target_core_sbc.c
@@ -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;