linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH rc8-mm1] hotfix libata-scsi corruption
@ 2008-01-22 17:11 Hugh Dickins
  2008-01-22 17:29 ` James Bottomley
  0 siblings, 1 reply; 13+ messages in thread
From: Hugh Dickins @ 2008-01-22 17:11 UTC (permalink / raw)
  To: Andrew Morton
  Cc: James Bottomley, Jeff Garzik, Alan Stern, linux-kernel, linux-ide

2.6.24-rc8-mm1 is corrupting.  smartd does some sg_ioctl into its stack,
and depending on how its stack randomization worked out, this is liable
to end up writing into the adjacent physical page too.  If you're lucky
you have highmem, and ioread16_rep oopses on the virtual address beyond
what ata_pio_sector's kmap_atomic set up; when you're unlucky, it'll go
ahead and corrupt the next page more obscurely.

Bisect led to scsi-misc-2.6.git's 465ff3185e0cb76d46137335a4d21d0d9d3ac8a2
[SCSI] relax scsi dma alignment, and the patch below is good for a hot-fix.
Though I doubt it'll be the final fix, since it appears to undo the whole
point of blk_queue_update_dma_alignment: perhaps libata is at fault to be
going through sectory code for unsectory I/O - I wouldn't know.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
---

 drivers/ata/libata-scsi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 2.6.24-rc8-mm1/drivers/ata/libata-scsi.c	2008-01-17 16:49:47.000000000 +0000
+++ linux/drivers/ata/libata-scsi.c	2008-01-22 15:45:40.000000000 +0000
@@ -826,7 +826,7 @@ static void ata_scsi_sdev_config(struct 
 	sdev->max_device_blocked = 1;
 
 	/* set the min alignment */
-	blk_queue_update_dma_alignment(sdev->request_queue, ATA_DMA_PAD_SZ - 1);
+	blk_queue_update_dma_alignment(sdev->request_queue, ATA_SECT_SIZE - 1);
 }
 
 static void ata_scsi_dev_config(struct scsi_device *sdev,

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-01-22 23:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).