From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Jeff Garzik <jeff@garzik.org>,
Alan Stern <stern@rowland.harvard.edu>,
linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH rc8-mm1] hotfix libata-scsi corruption
Date: Tue, 22 Jan 2008 16:12:10 -0600 [thread overview]
Message-ID: <1201039931.3210.96.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.64.0801222009070.16267@blonde.site>
On Tue, 2008-01-22 at 20:20 +0000, Hugh Dickins wrote:
> On Tue, 22 Jan 2008, James Bottomley wrote:
> >
> > Actually, I don't think it's a smaller I/O issue. The SMART protocol
> > specifically mandates that the transfers for SMART READ DATA and SMART
> > READ LOG shall be 512 bytes). However, the pio transfer routine does
> > seem to be assuming sector alignment as well, which will be where your
> > problems are coming from. I think we need to specify sector minimum
> > alignment for ata (but not atapi, which has its own non sector size pio
> > routine). How about the attached?
> >
> > We have to do this for all ATA devices, because they'll likely all
> > support SMART, and SMART is defined to be a PIO command.
>
> Thanks, you've answered several of my uncertainties (why the PIO,
> why the sector size).
>
> I've just tried it, and can confirm that your replacement patch
> below fixes the issue for me in practice.
Thanks!
> What I can't say, you and Jeff and others will judge, is whether that's
> actually the right placement for the blk_queue_update_dma_alignment call
> (as an outsider, I'm not convinced that the SMART requirement should be
> imposing this limitation on the rest).
It's certainly the correct placement. The slight problem is that the
actual alignment checking is only really done for commands coming down
from the user, not for commands incoming from the kernel. That leaves
us a potential nasty in IDENTIFY_DEVICE; that's also a PIO only 512 byte
transfer command.
libsas looks to be OK because it specifically kmallocs a 512 byte buffer
which should (for off slab data) be 512 byte aligned. libata actually
has an issue because the usual location for IDENTIFY_DEVICE data is
inside a struct ata_device, which is highly unlikely to be correctly
aligned. Fortunately, I think we can only get the bug if we actually
cross a page boundary for non contiguous pages in the identify data,
which a kernel allocation will never do, so libata should be safe as
well.
James
next prev parent reply other threads:[~2008-01-22 22:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-22 17:11 [PATCH rc8-mm1] hotfix libata-scsi corruption Hugh Dickins
2008-01-22 17:29 ` James Bottomley
2008-01-22 18:36 ` Hugh Dickins
2008-01-22 19:43 ` James Bottomley
2008-01-22 20:20 ` Hugh Dickins
2008-01-22 22:12 ` James Bottomley [this message]
2008-01-22 22:59 ` Hugh Dickins
2008-01-22 23:19 ` James Bottomley
2008-01-22 23:58 ` Matt Mackall
2008-01-22 20:32 ` Jeff Garzik
2008-01-22 23:00 ` James Bottomley
2008-01-22 22:12 ` Alan Cox
2008-01-22 22:41 ` Hugh Dickins
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=1201039931.3210.96.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=akpm@linux-foundation.org \
--cc=hugh@veritas.com \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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).