From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] scsi: sd_dif.c use unaligned access helpers
Date: Sat, 26 Jul 2008 00:22:41 -0400 [thread overview]
Message-ID: <yq1od4l8eb2.fsf@sermon.lab.mkp.net> (raw)
In-Reply-To: <1216854460.30386.32.camel@brick> (Harvey Harrison's message of "Wed\, 23 Jul 2008 16\:07\:40 -0700")
>>>>> "Harvey" == Harvey Harrison <harvey.harrison@gmail.com> writes:
[Sorry about the delayed response. I've been traveling for a few
days.]
Harvey> This code should be looked at carefully, while this patch
Harvey> doesn't change any behaviour, the handling of app_tag, ref_tag
Harvey> seems odd. The struct defines both as __be16/32 but in these
Harvey> locations it is read in/written out as cpu-byteorder.
The opaque tag space (app in Type 1+2, app + ref in Type 3) is
provided for use by filesystems. The SCSI layer doesn't know anything
about the contents of the tag buffer. It has no idea whether it
contains bytes, shorts, ints or longs. So we can't swab on the
assumption that each DIF tuple contains an u16. Just like we don't
byteswap any other data coming down from above.
Filesystems must prepare tags in an endianness-aware fashion just like
they prepare normal filesystem metadata. And at the SCSI layer we
treat it as a byte stream.
Harvey> It looks like they should actually be u16/u32.
Guard + ref tags are interpreted by the HBA and storage device and
they are defined to be big endian.
Consequently the DIF tuple tags are defined as __be16 and __be32 to be
in sync with the spec. But from a protocol perspective the notion of
endianness of the application tag is essentially meaningless. It is
not interpreted by anybody else than the filesystem.
--
Martin K. Petersen Oracle Linux Engineering
next prev parent reply other threads:[~2008-07-26 4:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-23 23:07 [PATCH] scsi: sd_dif.c use unaligned access helpers Harvey Harrison
2008-07-26 4:22 ` Martin K. Petersen [this message]
2008-07-26 5:14 ` Harvey Harrison
2008-07-26 12:26 ` Martin K. Petersen
2008-07-26 16:46 ` Harvey Harrison
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=yq1od4l8eb2.fsf@sermon.lab.mkp.net \
--to=martin.petersen@oracle.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=harvey.harrison@gmail.com \
--cc=linux-scsi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox