Re: MTD/block regression (was Re: Slub debugging NAND error in 2.6.25.10.atmel.2)

Previous thread: Re: [PATCH] x86: split e820 reserved entries record to late v2 by David Witbrodt on Friday, August 29, 2008 - 7:32 am. (2 messages)

Next thread: Re: SATA Cold Boot problems on >2.6.25 with NV by Robert Hancock on Friday, August 29, 2008 - 7:44 am. (48 messages)
From: Haavard Skinnemoen
Date: Friday, August 29, 2008 - 7:28 am

Ok, it turns out it's not related. It's a newly introduced regression
which I've bisected down to:

commit abf5439370491dd6fbb4fe1a7939680d2a9bc9d4
Author: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Date:   Sat Aug 16 14:10:05 2008 +0900

    block: move cmdfilter from gendisk to request_queue

    cmd_filter works only for the block layer SG_IO with SCSI block
    devices. It breaks scsi/sg.c, bsg, and the block layer SG_IO with SCSI
    character devices (such as st). We hit a kernel crash with them.

    The problem is that cmd_filter code accesses to gendisk (having struct
    blk_scsi_cmd_filter) via inode->i_bdev->bd_disk. It works for only
    SCSI block device files. With character device files, inode->i_bdev
    leads you to struct cdev. inode->i_bdev->bd_disk->blk_scsi_cmd_filter
    isn't safe.

    SCSI ULDs don't expose gendisk; they keep it private. bsg needs to be
    independent on any protocols. We shouldn't change ULDs to expose their
    gendisk.

    This patch moves struct blk_scsi_cmd_filter from gendisk to
    request_queue, a common object, which eveyone can access to.

    The user interface doesn't change; users can change the filters via
    /sys/block/. gendisk has a pointer to request_queue so the cmd_filter
    code accesses to struct blk_scsi_cmd_filter.

    Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
    Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

Unfortunately, I can't revert it cleanly, so it could be a false
positive. But it does sort of make sense, since it makes the filter
per-queue instead of per-gendisk, so if MTD uses the same queue for
several block devices, the filter kobject might end up being
initialized multiple times. Or something.

Haavard
--

From: FUJITA Tomonori
Date: Friday, August 29, 2008 - 6:34 pm

On Fri, 29 Aug 2008 16:28:24 +0200

Really sorry about that. A fix was queued in Jens' tree:


Right, the problem is that MTD uses the same queue for multiple
gendisks. It would be great if a MTD developer could fix it.


Thanks,
--

From: Haavard Skinnemoen
Date: Saturday, August 30, 2008 - 3:49 am

On Sat, 30 Aug 2008 10:34:12 +0900


Yeah, I sort of suspected that MTD was doing something unusual.
Unfortunately, I'm not familiar enough with the MTD and block code
to help out here...

Haavard	
--

From: Geert Uytterhoeven
Date: Sunday, August 31, 2008 - 5:00 am

I'm also seeing it with drivers/block/ataflop.c (also a single queue) on
ARAnyM.

And from looking at drivers/block/floppy.c and drivers/block/amiflop.c,
I guess it happens there, too.

Any other single-queue drivers that got broken???

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

From: Jens Axboe
Date: Sunday, August 31, 2008 - 9:55 am

The pending change will eliminate this problem so that single queue
devices will work fine again. They should still work fine in -rc5, just
with the annoying WARN_ON() for each device per queue.

-- 
Jens Axboe

--

Previous thread: Re: [PATCH] x86: split e820 reserved entries record to late v2 by David Witbrodt on Friday, August 29, 2008 - 7:32 am. (2 messages)

Next thread: Re: SATA Cold Boot problems on >2.6.25 with NV by Robert Hancock on Friday, August 29, 2008 - 7:44 am. (48 messages)