From: "adam radford" <aradford@gmail.com>
To: "Christopher S. Aker" <caker@theshore.net>
Cc: linux-kernel@vger.kernel.org,
"xen devel" <xen-devel@lists.xensource.com>
Subject: Re: ext3 directory corruption under Xen
Date: Mon, 23 Jun 2008 16:08:06 -0700 [thread overview]
Message-ID: <b1bc6a000806231608q2cc0bef2xe58719b27bd2a809@mail.gmail.com> (raw)
In-Reply-To: <485FFF41.3000603@theshore.net>
[-- Attachment #1: Type: text/plain, Size: 2880 bytes --]
On Mon, Jun 23, 2008 at 12:53 PM, Christopher S. Aker
<caker@theshore.net> wrote:
> adam radford wrote:
>>
>> On Mon, Jun 23, 2008 at 9:15 AM, Christopher S. Aker <caker@theshore.net>
>> wrote:
>>
>>> It's happened on a number of different hosts, all of the same hardware
>>> and
>>> software configuration (Xen 3.2 64bit, 32bit pae dom0, 32bit pae domUs.
>>> LVM
>>> backend with 3ware hardware RAID-1).
>
>>
>>
>> A driver patch for older kernels including XenServer-4.1 is available
>> here:
>>
>> http://www.3ware.com/KB/article.aspx?id=15243&cNode=6I1C6S
>
> Thanks, but unfortunately, from that link:
>
> "3ware 9000 series controllers are not affected by this issue."
>
> ... which is what we're using. This problem only appeared after rebooting
> these machines into Xen. Some of affected boxes even ran 2.6.18 (non Xen)
> for awhile without any problems.
>
> -Chris
>
I've seen cases where Xen DMA code (pci-dma-xen.c) sends I/O requests
un-necessarily through the SWIOTLB code.
Xen dma: avoid unnecessarily SWIOTLB bounce buffering:
http://lists.xensource.com/archives/html/xen-changelog/2008-04/msg00008.html
so you may need a similar bidirectional fix for the 3w-9xxx driver.
Can you try this patch (in-line below and also attached):
-Adam
diff -Naur linux-2.6.18-xen-3.2.0/drivers/scsi/3w-9xxx.c
linux-2.6.18-xen-3.2.0.new/drivers/scsi/3w-9xxx.c
--- linux-2.6.18-xen-3.2.0/drivers/scsi/3w-9xxx.c 2008-02-12
02:44:33.000000000 -0800
+++ linux-2.6.18-xen-3.2.0.new/drivers/scsi/3w-9xxx.c 2008-06-23
15:42:02.000000000 -0700
@@ -1388,7 +1388,7 @@
if (cmd->use_sg == 0)
goto out;
- use_sg = pci_map_sg(pdev, cmd->request_buffer, cmd->use_sg,
DMA_BIDIRECTIONAL);
+ use_sg = pci_map_sg(pdev, cmd->request_buffer, cmd->use_sg,
cmd->sc_data_direction);
if (use_sg == 0) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1c, "Failed to map scatter
gather list");
@@ -1415,7 +1415,7 @@
goto out;
}
- mapping = pci_map_single(pdev, cmd->request_buffer,
cmd->request_bufflen, DMA_BIDIRECTIONAL);
+ mapping = pci_map_single(pdev, cmd->request_buffer,
cmd->request_bufflen, cmd->sc_data_direction);
if (mapping == 0) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1d, "Failed to map page");
@@ -1423,7 +1423,7 @@
}
cmd->SCp.phase = TW_PHASE_SINGLE;
- cmd->SCp.have_data_in = mapping;
+ cmd->SCp.dma_handle = mapping;
retval = mapping;
out:
return retval;
@@ -2000,10 +2000,10 @@
switch(cmd->SCp.phase) {
case TW_PHASE_SINGLE:
- pci_unmap_single(pdev, cmd->SCp.have_data_in, cmd->request_bufflen,
DMA_BIDIRECTIONAL);
+ pci_unmap_single(pdev, cmd->SCp.dma_handle, cmd->request_bufflen,
cmd->sc_data_direction);
break;
case TW_PHASE_SGLIST:
- pci_unmap_sg(pdev, cmd->request_buffer, cmd->use_sg, DMA_BIDIRECTIONAL);
+ pci_unmap_sg(pdev, cmd->request_buffer, cmd->use_sg, cmd->sc_data_direction);
break;
}
} /* End twa_unmap_scsi_data() */
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 3w-9xxx_xen3.2.0.patch --]
[-- Type: text/x-patch; name=3w-9xxx_xen3.2.0.patch, Size: 1624 bytes --]
diff -Naur linux-2.6.18-xen-3.2.0/drivers/scsi/3w-9xxx.c linux-2.6.18-xen-3.2.0.new/drivers/scsi/3w-9xxx.c
--- linux-2.6.18-xen-3.2.0/drivers/scsi/3w-9xxx.c 2008-02-12 02:44:33.000000000 -0800
+++ linux-2.6.18-xen-3.2.0.new/drivers/scsi/3w-9xxx.c 2008-06-23 15:42:02.000000000 -0700
@@ -1388,7 +1388,7 @@
if (cmd->use_sg == 0)
goto out;
- use_sg = pci_map_sg(pdev, cmd->request_buffer, cmd->use_sg, DMA_BIDIRECTIONAL);
+ use_sg = pci_map_sg(pdev, cmd->request_buffer, cmd->use_sg, cmd->sc_data_direction);
if (use_sg == 0) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1c, "Failed to map scatter gather list");
@@ -1415,7 +1415,7 @@
goto out;
}
- mapping = pci_map_single(pdev, cmd->request_buffer, cmd->request_bufflen, DMA_BIDIRECTIONAL);
+ mapping = pci_map_single(pdev, cmd->request_buffer, cmd->request_bufflen, cmd->sc_data_direction);
if (mapping == 0) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1d, "Failed to map page");
@@ -1423,7 +1423,7 @@
}
cmd->SCp.phase = TW_PHASE_SINGLE;
- cmd->SCp.have_data_in = mapping;
+ cmd->SCp.dma_handle = mapping;
retval = mapping;
out:
return retval;
@@ -2000,10 +2000,10 @@
switch(cmd->SCp.phase) {
case TW_PHASE_SINGLE:
- pci_unmap_single(pdev, cmd->SCp.have_data_in, cmd->request_bufflen, DMA_BIDIRECTIONAL);
+ pci_unmap_single(pdev, cmd->SCp.dma_handle, cmd->request_bufflen, cmd->sc_data_direction);
break;
case TW_PHASE_SGLIST:
- pci_unmap_sg(pdev, cmd->request_buffer, cmd->use_sg, DMA_BIDIRECTIONAL);
+ pci_unmap_sg(pdev, cmd->request_buffer, cmd->use_sg, cmd->sc_data_direction);
break;
}
} /* End twa_unmap_scsi_data() */
prev parent reply other threads:[~2008-06-23 23:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-23 16:15 Christopher S. Aker
2008-06-23 19:13 ` adam radford
2008-06-23 19:53 ` Christopher S. Aker
2008-06-23 23:08 ` adam radford [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=b1bc6a000806231608q2cc0bef2xe58719b27bd2a809@mail.gmail.com \
--to=aradford@gmail.com \
--cc=caker@theshore.net \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xensource.com \
/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
all inboxes | Powered by JetHome®