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

From: Geert Uytterhoeven
Date: Wed Sep 29 2010 - 05:19:25 EST


On Tue, Sep 28, 2010 at 23:19, richard -rw- weinberger
<richard.weinberger@xxxxxxxxx> wrote:
> 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.

Thanks, good to know!

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

So we can no longer process more than one sector? Why?

Could it be 4d6c84d91d1a539ebc47d1a36a35e9390ba11fdc (ubd: cleanup
completion path),
which is one of the three commits you pointed out?

Before 4d6c84d91d1a539ebc47d1a36a35e9390ba11fdc, blk_end_request() was
only called when
rq->nr_sectors reached zero.
Now it's called for each part.

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
--
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/