From: Douglas Gilbert <dgilbert@interlog.com>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>,
linux1394-devel@lists.sourceforge.net
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH] firewire: sbp2: allow WRITE SAME and REPORT SUPPORTED OPERATION CODES
Date: Mon, 16 Dec 2013 09:42:28 -0500 [thread overview]
Message-ID: <52AF1154.1020509@interlog.com> (raw)
In-Reply-To: <20131215155238.6016b038@stein>
On 13-12-15 09:52 AM, Stefan Richter wrote:
> On Dec 02 2012 Stefan Richter wrote:
>> On Nov 26 Martin K. Petersen wrote:
>>>>>>>> "Stefan" == Stefan Richter <stefanr@s5r6.in-berlin.de> writes:
>>> Stefan> I did not try "sg_write_same" on any of the devices; but since
>>> Stefan> the two SPC-3 devices are correctly identified as "fully
>>> Stefan> provisioned", won't issue WRITE SAME to them either.
>> ^[the kernel]
>>>
>>> What if you have an SSD behind one of them?
>>
>> At the moment I only have a single old SSD available which does not
>> implement ATA TRIM as far as I recall.
>>
>> And the two mentioned OXUF936QSE based SPC-3 devices are four-bay SATA disk
>> enclosures whose firmwares only support various RAID modes and require at
>> least two bays to be populated. I.e. I can't test them with the SSD for
>> now. But I suspect that they don't implement thin provisioning anyway,
>> particularly translation of WRITE SAME with UNMAP to ATA TRIM.
>>
>> But now I found another SPC-3 compliant device in my stash; a dual SATA
>> bridge based on OXUF934DSB which supports JBOD with 1...2 disks
>> alternatively to striping/ spanning/ mirroring over 2 disks. I attached
>> the old SSD to it, and its thin_provisioning sysfs attribute was shown as
>> 0 as well. "sg_write_same -U ..." on this device in the 10 and 16 byte
>> variants ended with Illegal Request/ Invalid command operation code, but
>> otherwise without discernible malfunction.
>>
>>> Stefan> Hence let's remove the no_report_opcodes and no_write_same
>>> Stefan> blacklist flags so that these commands can be used on
>>> Stefan> respectively capable targets.
>>>
>>> I just erred on the side of caution. If you are happy without belt and
>>> suspenders that's perfectly ok with me :)
>>
>> Blacklisting at first was definitely the right approach. But now that I
>> looked at a variety of older and newer devices, I am confident that the
>> general Inquiry_Data.Version >= SPC-3 test keeps the wackier among the
>> SBP-2 devices safe enough.
>
> (I followed up with https://git.kernel.org/linus/b0ea5f19d3d8.)
>
>> Of course it remains to be seen what happens with ATA TRIM enabled SSDs
>> behind the newer SPC-3 compliant bridges, but at this time the risk with
>> those seems low.
>
> I now tested
> - ONNTO dataTale RSM4QO (OXUF936QSE) with two Samsung 840 Pro in RAID 0,
> - ONNTO dataTale RSM4QO (OXUF936QSE) with two Samsung 840 Pro in RAID 1,
> - IOI FWBU2-DSATA12 (OXUF934DSB) with one Samsung 840 Pro
> and kernel 3.9.
>
> $ grep . /sys/class/scsi_disk/42\:0\:0\:0/*prov*
> /sys/class/scsi_disk/42:0:0:0/provisioning_mode:full
> /sys/class/scsi_disk/42:0:0:0/thin_provisioning:0
> # sg_opcodes /dev/sdg
> Ext Hard Disk
> Peripheral device type: disk
> Report supported operation codes: operation not supported
> # sg_write_same --10 --lba=1 /dev/sdg
> Write same(10) command not supported
> # sg_write_same --16 --lba=1 /dev/sdg
> Write same(16) command not supported
> # sg_write_same --32 --lba=1 /dev/sdg
> Write same: pass through os error: Invalid argument
> Write same(32) command failed
The sg driver does not support SCSI commands of greater
than 16 bytes. That is the reason for the "pass-through
os error" on your '--32' variant above. For now you need
to send the '--32' variant to the bsg driver instead.
I have presented a patch to relax the 16 byte cdb limit
on the sg driver:
http://www.spinics.net/lists/linux-scsi/msg70283.html
Like most of my patches that one seems to be residing
in James' /dev/null file for later consideration.
Doug Gilbert
> I will send a patch which reverts the drivers/firewire/sbp2.c hunk of
> https://git.kernel.org/linus/54b2b50c20a6 "[SCSI] Disable WRITE SAME for
> RAID and virtual host adapter drivers". (As an aside, sbp2.c implements a
> transport, not a virtual host adapter.)
>
next prev parent reply other threads:[~2013-12-16 14:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-25 17:45 [PATCH] firewire: sbp2: allow WRITE SAME and REPORT SUPPORTED OPERATION CODES Stefan Richter
2012-11-26 23:50 ` Martin K. Petersen
2012-12-02 18:16 ` Stefan Richter
2013-12-15 14:52 ` Stefan Richter
2013-12-15 15:40 ` [PATCH v3.13-rc3] firewire: sbp2: bring back WRITE SAME support Stefan Richter
2013-12-17 22:18 ` Martin K. Petersen
2013-12-16 14:42 ` Douglas Gilbert [this message]
2013-12-22 11:26 ` [PATCH] firewire: sbp2: allow WRITE SAME and REPORT SUPPORTED OPERATION CODES Stefan Richter
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=52AF1154.1020509@interlog.com \
--to=dgilbert@interlog.com \
--cc=linux-scsi@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
--cc=martin.petersen@oracle.com \
--cc=stefanr@s5r6.in-berlin.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).