From: Douglas Gilbert <dgilbert@interlog.com>
To: Christoph Hellwig <hch@lst.de>,
"Nicholas A. Bellinger" <nab@daterainc.com>
Cc: target-devel <target-devel@vger.kernel.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
Ronnie Sahlberg <ronniesahlberg@gmail.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Hannes Reinecke <hare@suse.de>,
Bart Van Assche <bvanassche@acm.org>,
Nicholas Bellinger <nab@linux-iscsi.org>
Subject: Re: [PATCH 5/8] target: Add sanity checks for DPO/FUA bit usage
Date: Sun, 22 Feb 2015 15:19:16 -0500 [thread overview]
Message-ID: <54EA39C4.9040907@interlog.com> (raw)
In-Reply-To: <20150222164114.GA1484@lst.de>
On 15-02-22 11:41 AM, Christoph Hellwig wrote:
> On Sat, Feb 14, 2015 at 03:27:40AM +0000, Nicholas A. Bellinger wrote:
>> From: Nicholas Bellinger <nab@linux-iscsi.org>
>>
>> This patch adds a sbc_check_dpofua() function that performs sanity
>> checks for DPO/FUA command bits.
>>
>> It introduces checks to fail when either bit is set, but the backend
>> device is not advertising support for them.
>>
>> It also moves the existing cmd->se_cmd_flags |= SCF_FUA assignement
>> into the new helper function.
>
> This causes I/O errors with ext4 on tcm_loop on what seems to be the first
> journal commit:
>
> [ 41.818126] EXT4-fs (sdc): mounted filesystem with ordered data mode. Opts: (null)
> [ 48.919107] Got CDB: 0x2a with FUA bit set, but device does not advertise support for FUA write
> [ 48.920245] sd 3:0:0:0: [sdc] tag#113 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
> [ 48.921219] sd 3:0:0:0: [sdc] tag#113 Sense Key : Illegal Request [current]
> [ 48.921980] sd 3:0:0:0: [sdc] tag#113 Add. Sense: Invalid field in cdb
Setting (or clearing) the FUA bit on READ or WRITE commands
does not cause an error according to sbc4r05 irrespective of
the LU's support for volatile and non-volatile caches. I'm
pretty sure that hasn't changed recently (say 15 years).
There is the curious DPOFUA bit in the device specific parameter
field for block devices. It can be fetched with MODE SENSE and serves
to inform the app client (Linux) that the DPO and FUA bit are
not supported. Hence when those bits are used in commands associated
with reading and writing the medium, they should acted upon if
supported or else ignored silently.
Please consider the code in scsi_debug (i.e. mk_sense_invalid_fld())
to set the sense key specific sense data on Illegal Requests. This
is to set the Field pointer to indicate which byte (and optionally
bit) in the cdb (or parameter data) that the target objects to.
Doug Gilbert
next prev parent reply other threads:[~2015-02-22 20:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-14 3:27 [PATCH 0/8] target: Fixes for SPC/SBC device emulation Nicholas A. Bellinger
2015-02-14 3:27 ` [PATCH 1/8] target: Add missing WRITE_SAME end-of-device sanity check Nicholas A. Bellinger
2015-02-14 3:27 ` [PATCH 2/8] target: Check for LBA + sectors wrap-around in sbc_parse_cdb Nicholas A. Bellinger
2015-02-15 8:18 ` Sagi Grimberg
2015-02-14 3:27 ` [PATCH 3/8] target: Fail I/O with PROTECT bit when protection is unsupported Nicholas A. Bellinger
2015-02-15 8:33 ` Sagi Grimberg
2015-02-14 3:27 ` [PATCH 4/8] target: Perform PROTECT sanity checks for WRITE_SAME Nicholas A. Bellinger
2015-02-15 17:22 ` Sagi Grimberg
2015-02-14 3:27 ` [PATCH 5/8] target: Add sanity checks for DPO/FUA bit usage Nicholas A. Bellinger
2015-02-16 11:10 ` Sagi Grimberg
2015-02-22 16:41 ` Christoph Hellwig
2015-02-22 20:19 ` Douglas Gilbert [this message]
2015-02-22 20:44 ` James Bottomley
2015-02-22 21:48 ` Douglas Gilbert
2015-02-23 6:13 ` Nicholas A. Bellinger
2015-02-14 3:27 ` [PATCH 6/8] target: Fail WRITE_SAME w/ UNMAP=1 when emulate_tpws=0 Nicholas A. Bellinger
2015-02-14 3:27 ` [PATCH 7/8] target: Fail UNMAP when emulate_tpu=0 Nicholas A. Bellinger
2015-02-14 3:27 ` [PATCH 8/8] target: Set LBPWS10 bit in Logical Block Provisioning EVPD Nicholas A. Bellinger
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=54EA39C4.9040907@interlog.com \
--to=dgilbert@interlog.com \
--cc=bvanassche@acm.org \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=nab@daterainc.com \
--cc=nab@linux-iscsi.org \
--cc=ronniesahlberg@gmail.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.