All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"dgilbert@interlog.com" <dgilbert@interlog.com>
Cc: "hare@suse.de" <hare@suse.de>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Subject: Re: [PATCH v2 5/5] scsi_debug: add resp_write_scat function
Date: Thu, 14 Dec 2017 22:57:46 +0000	[thread overview]
Message-ID: <1513292262.2475.100.camel@sandisk.com> (raw)
In-Reply-To: <20171214014016.13142-6-dgilbert@interlog.com>

On Wed, 2017-12-13 at 20:40 -0500, Douglas Gilbert wrote:
> +	{0, 0x7f, 0x11, F_SA_HIGH | F_D_OUT | FF_MEDIA_IO, resp_write_scat,
> +	    NULL, {32,  0xc7, 0, 0, 0, 0, 0x3f, 0x18, 0x0, 0x11, 0xf8,
> +		   0, 0xff, 0xff, 0x0, 0x0} },	/* WRITE SCATTERED(32) */

I know this is consistent with other command declarations in the scsi_debug
driver, but it seems weird to me to report to the initiator that only some
bits of the ADDITIONAL CDB LENGTH fields are supported (0x18)? From SPC-5:

The CDB USAGE DATA field contains information about the CDB for the command
being queried. The first byte of the CDB USAGE DATA field shall contain the
operation code for the command being queried. If the command being queried
contains a service action, then that service action code shall be placed in
the CDB USAGE DATA field in the same location as the SERVICE ACTION field of
the command CDB. All other bytes of the CDB USAGE DATA field shall contain a
usage map for bits in the CDB for the command being queried.
 
> +	lrdp = kzalloc(lbdof_blen, GFP_ATOMIC);
> +	if (lrdp == NULL) {
> +		mk_sense_buffer(scp, ILLEGAL_REQUEST, INSUFF_RES_ASC,
> +				INSUFF_RES_ASCQ);
> +		return illegal_condition_result;
> +	}

It seems weird to me to report a fatal error to the initiator if a memory
allocation fails? I think other SCSI LLDs return SCSI_MLQUEUE_HOST_BUSY if a
memory allocation fails.

Thanks,

Bart.

  reply	other threads:[~2017-12-14 22:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14  1:40 [PATCH v2 0/5] scsi_debug: add write scattered support Douglas Gilbert
2017-12-14  1:40 ` [PATCH v2 1/5] scsi_debug: tab, kstrto changes Douglas Gilbert
2017-12-14 22:15   ` Bart Van Assche
2017-12-14  1:40 ` [PATCH v2 2/5] scsi_debug: fix group_number mask Douglas Gilbert
2017-12-14 22:26   ` Bart Van Assche
2017-12-14  1:40 ` [PATCH v2 3/5] scsi_debug: do_device_access, add sg offset argument Douglas Gilbert
2017-12-14 22:27   ` Bart Van Assche
2017-12-14  1:40 ` [PATCH v2 4/5] scsi_debug: ARRAY_SIZE() and FF_MEDIA_IO Douglas Gilbert
2017-12-14 22:30   ` Bart Van Assche
2017-12-14  1:40 ` [PATCH v2 5/5] scsi_debug: add resp_write_scat function Douglas Gilbert
2017-12-14 22:57   ` Bart Van Assche [this message]
2017-12-15  2:44     ` Douglas Gilbert

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=1513292262.2475.100.camel@sandisk.com \
    --to=bart.vanassche@wdc.com \
    --cc=dgilbert@interlog.com \
    --cc=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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.