[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Linux 3.1 domU + ext3 = WARNING: at fs/ext3/inode.c

On Wed, Oct 26, 2011 at 05:23:40PM -0400, Christopher S. Aker wrote:
> On 10/26/11 4:36 PM, Konrad Rzeszutek Wilk wrote:
> > I am going to bet that if you compile 3.0.4 or 3.0.6 with that
> > fancy new config option that turns EXT3_ORDERED_something you will
> > see the same exact problem.
> Switching that back to match my 3.0 config is the first thing I
> tried, with no joy.
> I'll reset and try a few more ideas...

I think I know what the problem is. I believe you need the patch below
in your hosts that are using the older dom0. AT least that solved the problem
for me when I tried to use a 2.6.18 based dom0 with a 3.0 kernel
with barriers. If you are using the linux-2.6.18.hg tree you might want
to just pull it and rebuild it - it has this patch already.

# HG changeset patch
From: Jan Beulich <jbeulich@xxxxxxxxxx>
# Date 1306409621 -3600
# Node ID 876a5aaac0264cf38cae6581e5714b93ec380aaa
# Parent  aedb712c05cf065e943e15d0f38597c2e80f7982
Subject: xen/blkback: don't fail empty barrier requests

The sector number on empty barrier requests may (will?) be
uninitialized (neither bio_init() nor rq_init() set the respective
fields), which allows for exceeding the actual (virtual) disk's size.

Inspired by Konrad's "When writting barriers set the sector number to
zero...", but instead of zapping the sector number (which is wrong for
non-empty ones) just ignore the sector number when the sector count is

While at it also add overflow checking to the math in vbd_translate().

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

diff -r aedb712c05cf -r 876a5aaac026 drivers/xen/blkback/vbd.c
--- a/drivers/xen/blkback/vbd.c Thu May 26 08:09:04 2011 +0100
+++ b/drivers/xen/blkback/vbd.c Thu May 26 12:33:41 2011 +0100
@@ -108,8 +108,14 @@ int vbd_translate(struct phys_req *req, 
        if ((operation != READ) && vbd->readonly)
                goto out;
-       if (unlikely((req->sector_number + req->nr_sects) > vbd_sz(vbd)))
-               goto out;
+       if (likely(req->nr_sects)) {
+               blkif_sector_t end = req->sector_number + req->nr_sects;
+               if (unlikely(end < req->sector_number))
+                       goto out;
+               if (unlikely(end > vbd_sz(vbd)))
+                       goto out;
+       }
        req->dev  = vbd->pdevice;
        req->bdev = vbd->bdev;
> -Chris

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.