All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Damien Le Moal <damien.lemoal@wdc.com>
Cc: Mike Christie <mchristi@redhat.com>,
	target-devel@vger.kernel.org, linux-scsi@vger.kernel.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Hannes Reinecke <hare@suse.de>,
	Bart Van Assche <bart.vanassche@sandisk.com>
Subject: Re: [PATCH 4/5] target: user: Fix sense data handling
Date: Thu, 06 Jul 2017 23:06:56 -0700	[thread overview]
Message-ID: <1499407616.30628.46.camel@haakon3.risingtidesystems.com> (raw)
In-Reply-To: <1499407500.30628.45.camel@haakon3.risingtidesystems.com>

On Thu, 2017-07-06 at 23:05 -0700, Nicholas A. Bellinger wrote:
> On Fri, 2017-07-07 at 14:14 +0900, Damien Le Moal wrote:
> > Nicholas,
> > 
> > On 7/7/17 13:50, Nicholas A. Bellinger wrote:
> > > Hey MNC & Co,
> > > 
> > > On Wed, 2017-06-28 at 12:44 -0500, Mike Christie wrote:
> > >> On 06/28/2017 12:58 AM, Damien Le Moal wrote:
> > >>> If the user request handler completed the request with a CHECK CONDITION
> > >>> status, tcmu_handle_completion() copies the command entry sense data
> > >>> into the session request structure sense data. However, the sense data
> > >>> length indicated by the field scsi_sense_length is not set and equal to
> > >>> 0, resulting in the copy being a no-op and failure to propagate the
> > >>> sense data back to the initiator. To fix this, properly set the session
> > >>> command sense data length and also set the session command
> > >>> SCF_TRANSPORT_TASK_SENSE flag to indicate that the command has valid
> > >>> sense data.
> > >>>
> > >>> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> > >>> ---
> > >>>  drivers/target/target_core_user.c | 4 +++-
> > >>>  1 file changed, 3 insertions(+), 1 deletion(-)
> > >>>
> > >>> diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
> > >>> index beb5f09..7426b4c 100644
> > >>> --- a/drivers/target/target_core_user.c
> > >>> +++ b/drivers/target/target_core_user.c
> > >>> @@ -831,7 +831,9 @@ static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry *
> > >>>  		entry->rsp.scsi_status = SAM_STAT_CHECK_CONDITION;
> > >>>  	} else if (entry->rsp.scsi_status == SAM_STAT_CHECK_CONDITION) {
> > >>>  		memcpy(se_cmd->sense_buffer, entry->rsp.sense_buffer,
> > >>> -			       se_cmd->scsi_sense_length);
> > >>> +		       TRANSPORT_SENSE_BUFFER);
> > >>> +		se_cmd->scsi_sense_length = TRANSPORT_SENSE_BUFFER;
> > >>> +		se_cmd->se_cmd_flags |= SCF_TRANSPORT_TASK_SENSE;
> > >>>  	} else if (se_cmd->se_cmd_flags & SCF_BIDI) {
> > >>>  		/* Get Data-In buffer before clean up */
> > >>>  		gather_data_area(udev, cmd, true);
> > >>>
> > >>
> > >> I have a patch similar to this and 5/5 in my set:
> > >>
> > >> https://www.spinics.net/lists/target-devel/msg15430.html
> > >>
> > >> If yours gets merged first then I will build my set over them, so patch
> > >> looks ok to me.
> > >>
> > >> Reviewed-by: Mike Christie <mchristi@redhat.com>
> > > 
> > > The RFC patches above from May 31st weren't merged because I thought you
> > > where going to send out a second series..
> > 
> > My apologies. I have been busy with other things and could not get to that.
> > 

Oh btw, I was talking to MNC wrt to his original patch series, and not
yours.  :)

  reply	other threads:[~2017-07-07  6:06 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-28  5:58 [PATCH 0/5] target: Zoned block device support and bug fixes Damien Le Moal
2017-06-28  5:58 ` [PATCH 1/5] target: Use macro for WRITE_VERIFY_xx operation codes Damien Le Moal
2017-07-07  5:00   ` Nicholas A. Bellinger
2017-06-28  5:58 ` [PATCH 2/5] target: pscsi: Introduce TYPE_ZBC support Damien Le Moal
2017-07-07  5:00   ` Nicholas A. Bellinger
2017-06-28  5:58 ` [PATCH 3/5] target: pscsi: Fix sense data handling Damien Le Moal
2017-07-07  5:02   ` Nicholas A. Bellinger
2017-06-28  5:58 ` [PATCH 4/5] target: user: " Damien Le Moal
2017-06-28 17:44   ` Mike Christie
2017-06-29  2:26     ` Damien Le Moal
2017-07-07  4:50     ` Nicholas A. Bellinger
2017-07-07  5:14       ` Damien Le Moal
2017-07-07  6:05         ` Nicholas A. Bellinger
2017-07-07  6:06           ` Nicholas A. Bellinger [this message]
2017-07-07  6:18             ` Damien Le Moal
2017-07-10  5:36           ` Damien Le Moal
2017-07-10 17:26             ` Mike Christie
2017-07-11  0:57               ` Damien Le Moal
2017-07-07 17:19       ` Mike Christie
2017-07-07  5:04   ` Nicholas A. Bellinger
2017-06-28  5:59 ` [PATCH 5/5] target: core: Fix failed command " Damien Le Moal
2017-06-28 17:45   ` Mike Christie
2017-07-07  5:06   ` Nicholas A. Bellinger
2017-06-28 14:34 ` [PATCH 0/5] target: Zoned block device support and bug fixes Bryant G. Ly
2017-06-29  2:24   ` Damien Le Moal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1499407616.30628.46.camel@haakon3.risingtidesystems.com \
    --to=nab@linux-iscsi.org \
    --cc=bart.vanassche@sandisk.com \
    --cc=damien.lemoal@wdc.com \
    --cc=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mchristi@redhat.com \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.