All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manoj Kumar <manoj@linux.vnet.ibm.com>
To: Brian King <brking@linux.vnet.ibm.com>,
	"Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>,
	linux-scsi@vger.kernel.org,
	James.Bottomley@HansenPartnership.com, nab@linux-iscsi.org,
	wenxiong@linux.vnet.ibm.com
Cc: hch@infradead.org, mikey@neuling.org, imunsie@au1.ibm.com,
	dja@ozlabs.au.ibm.com
Subject: Re: [PATCH v3 3/4] cxlflash: Superpipe support
Date: Thu, 06 Aug 2015 16:35:02 -0500	[thread overview]
Message-ID: <55C3D306.3090800@linux.vnet.ibm.com> (raw)
In-Reply-To: <55C3C78D.7070900@linux.vnet.ibm.com>

Brian: Thanks for your review. See comments inline, below.

- Manoj Kumar

On 8/6/2015 3:46 PM, Brian King wrote:
>>    * cxlflash_queuecommand() - sends a mid-layer request
>>    * @host:	SCSI host associated with device.
>>    * @scp:	SCSI command to send.
>> @@ -512,6 +535,13 @@ static int cxlflash_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scp)
>>   			     get_unaligned_be32(&((u32 *)scp->cmnd)[2]),
>>   			     get_unaligned_be32(&((u32 *)scp->cmnd)[3]));
>>
>> +	/* Fail all read/write commands when in operating superpipe mode */
>> +	if (scp->device->hostdata && is_scsi_read_write(scp)) {
>> +		pr_debug_ratelimited("%s: LUN being used in superpipe mode. "
>> +				     "Operation not allowed!\n", __func__);
>> +		goto error;
>> +	}
>
> Not sure I like this. A couple of concerns:
>
> 1. Any process that comes along and issues a read to the device will result in I/O errors getting logged
>     by the layers above you. The general expectation is that if reads or writes are failing on a block device,
>     then something is wrong and the user should know about it. A user innocently running "fdisk -l", for example,
>     to list all disk partitions on the system, would see errors getting logged for every disk configured for
>     superpipe mode.
> 2. How will users know that devices are in superpipe mode? The only indication is the driver specific sysfs attribute
>     that no existing tooling will be checking. GUI tools to do disk partitioning and such will see these devices
>     and present them to the user with the expectation that something can be done with them.
> 3. If this is a multipath device, you'll have a dm device sitting on top of this and potentially have multipathd doing health
>     checking periodically and these devices will show up in multipath -ll output.
>
> It seems to me like the cleanest option would be, when switching into superpipe mode, for the user code doing
> this to unbind the sd driver from the relevant scsi device. This will prevent any reads or writes from being
> issued to the LUN from the block layer, since there will no longer be any way to do this. It will also prevent
> these devices from showing up in GUIs and menus where we don't want them to.
>
> So, I'd say, kill this snooping of the op code and failing I/O in superpipe mode, and solve this in userspace.

The intent of this snooping and failing I/O was to prevent an accidental 
over-write of the LUN in superpipe mode by some other user unaware of 
our sysfs attribute. This was an additional precautionary measure to 
unbinding the sd driver from the relevant scsi device. We can fall back 
on to that primary mechanism.


>> +	gli->max_lba = swab64(*((u64 *)&cmd_buf[0]));
>> +	gli->blk_len = swab32(*((u32 *)&cmd_buf[8]));
>
> This doesn't look right. How does this work on big endian? I think you want to be using
> be64_to_cpu and be32_to_cpu here.
>

Good catch. Will rectify in the v4 patch.


      reply	other threads:[~2015-08-06 21:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03  4:33 [PATCH v3 3/4] cxlflash: Superpipe support Matthew R. Ochs
2015-08-06 20:46 ` Brian King
2015-08-06 21:35   ` Manoj Kumar [this message]

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=55C3D306.3090800@linux.vnet.ibm.com \
    --to=manoj@linux.vnet.ibm.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=brking@linux.vnet.ibm.com \
    --cc=dja@ozlabs.au.ibm.com \
    --cc=hch@infradead.org \
    --cc=imunsie@au1.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mikey@neuling.org \
    --cc=mrochs@linux.vnet.ibm.com \
    --cc=nab@linux-iscsi.org \
    --cc=wenxiong@linux.vnet.ibm.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.