Re: [uml-devel] [REGRESSION] um: ubd: block layer issue (Was: ext3filesystem corruption in user mode linux)

From: richard -rw- weinberger
Date: Tue Sep 28 2010 - 17:19:54 EST


On Tue, Sep 28, 2010 at 10:37 PM, Geert Uytterhoeven
<geert@xxxxxxxxxxxxxx> wrote:
>
> This changeset from 2007 indeed moved the update of req->sector.
>
> However, in the new code, before or after applying your patch, there's no update
> of req->sector anymore. Everything is done in local variables.
>
> Is it possible that we only need the hunk below to fix the corruption?

Yes, it seems so. So far all my test cases work fine.
I'll submit a patch in a few minutes.

> | diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
> | index 5ff5546..655ed9e 100644
> | --- a/arch/um/drivers/ubd_kern.c
> | +++ b/arch/um/drivers/ubd_kern.c
> | @@ -746,8 +746,12 @@ static int ubd_open_dev(struct ubd *ubd_dev)
> |       }
> |       ubd_dev->fd = fd;
> |
> | +     /* A setting higher than 1 sector currently (v2.6.33) generates
> | +     data loss, both for raw and cow ubd. */
> | +     blk_queue_max_sectors(ubd_dev->queue, 1 * sizeof(long));
> | +     blk_queue_max_phys_segments(ubd_dev->queue, 1 * sizeof(long));
> | +
> |       if(ubd_dev->cow.file != NULL){
> | -             blk_queue_max_sectors(ubd_dev->queue, 8 * sizeof(long));
> |
> |               err = -ENOMEM;
> |               ubd_dev->cow.bitmap = vmalloc(ubd_dev->cow.bitmap_len);
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds
>

--
Cheers,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/