From: Sebastian Parschauer <sebastian.riemer@profitbricks.com>
To: Vladislav Bolkhovitin <vst@vlnb.net>
Cc: Christoph Hellwig <hch@infradead.org>,
Bart Van Assche <bart.vanassche@sandisk.com>,
Scst-devel <Scst-devel@lists.sourceforge.net>,
linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: sd: Resize-fsync() race fails IO
Date: Thu, 24 Mar 2016 10:46:08 +0100 [thread overview]
Message-ID: <56F3B760.2060309@profitbricks.com> (raw)
In-Reply-To: <56F368EA.1010607@vlnb.net>
On 24.03.2016 05:11, Vladislav Bolkhovitin wrote:
[snip]
>>>> +CC: linux-scsi, hch
>>>>
>>>> Hi SCSI developers,
>>>>
>>>> I've debugged this further with a v4.5 kernel and full SCSI command
>>>> logging enabled on the initiator side. It seems to be a SCSI issue. SCSI
>>>> commands succeed but result 8000002 is reported to the upper driver
>>>> which seems to fail IO.
>>>>
>>>> What does result 8000002 mean?
>>>
>>> It is driver_byte() DID_RESET and status_byte() CHECK_CONDITION (see the corresponding
>>> kernel's functions). It sounds like you have timeouts and resets somewhere.
>>
>> Thanks for the hint! But it is definitely not DID_RESET. It is
>> DRIVER_SENSE and CHECK_CONDITION then. The host byte is DID_OK.
>>
>> If Unit Attention and "Capacity data has changed" is part of a read or a
>> write, then the result is the same but this is handled correctly and IO
>> is not failed. But with a zero bytes fsync()/flush resulting in
>> SYNCHRONIZE_CACHE_16, it fails IO as the sd driver doesn't handle this
>> correctly it seems.
>
> I'm not sure, what is not handled correctly? Zero length SYNCHRONIZE_CACHE is perfectly
> legal, and vdisk_fsync() should never see data_len 0.
The issue is located in the SCSI stack. I think the problem is located
in the sd driver. It can't handle zero length SYNCHRONIZE_CACHE together
with UA and "Capacity data changed". The race exists to which SCSI
command UA is put to.
> There should be no race around virt_dev->file_size, because assignments to 64-bit
> integers are atomic, the compiler supposed to align it to 64-bit boundaries and it's
> never assigned to any invalid value. At worst, accesses to it should be covered by
> ACCESS_ONCE(), but I'm not sure it is really needed, so would prefer to keep it away
> from the fast path. Although, probably, vdisk_synchronize_cache() is not too fast path.
SCST is fine. I couldn't break it with my tests. It succeeds the
commands but the sd driver fails IO because of the sense data.
So discussion should be moved to the linux-scsi list again.
I've changed the prefix in the subject from "scst_vdisk" to "sd".
[snip]
prev parent reply other threads:[~2016-03-24 9:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <56EBEFAA.9040501@profitbricks.com>
2016-03-21 15:22 ` scst_vdisk: Resize-fsync() race fails IO Sebastian Parschauer
[not found] ` <56F20A8C.4010202@vlnb.net>
[not found] ` <56F25C8F.9040801@profitbricks.com>
[not found] ` <56F368EA.1010607@vlnb.net>
2016-03-24 9:46 ` Sebastian Parschauer [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=56F3B760.2060309@profitbricks.com \
--to=sebastian.riemer@profitbricks.com \
--cc=Scst-devel@lists.sourceforge.net \
--cc=bart.vanassche@sandisk.com \
--cc=hch@infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=vst@vlnb.net \
/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.