Re: segfault mdadm --write-behind, 2.6.14-mm2 (was: Re: RAID1ramdisk patch)

From: Neil Brown
Date: Wed Nov 16 2005 - 18:08:25 EST


On Wednesday November 16, akpm@xxxxxxxx wrote:
> Sander <sander@xxxxxxxxxxx> wrote:
> >
> >
> > With 2.6.14-mm2 (x86) and mdadm 2.1 I get a Segmentation fault when I
> > try this:
>
> It oopsed in reiser4. reiserfs-dev added to Cc...
>

Hmm... It appears that md/bitmap is calling prepare_write and
commit_write with 'file' as NULL - this works for some filesystems,
but not for reiser4.

Does this patch help.

Signed-off-by: Neil Brown <neilb@xxxxxxx>

### Diffstat output
./drivers/md/bitmap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff ./drivers/md/bitmap.c~current~ ./drivers/md/bitmap.c
--- ./drivers/md/bitmap.c~current~ 2005-11-17 10:05:18.000000000 +1100
+++ ./drivers/md/bitmap.c 2005-11-17 10:05:40.000000000 +1100
@@ -326,9 +326,9 @@ static int write_page(struct bitmap *bit
}
}

- ret = page->mapping->a_ops->prepare_write(NULL, page, 0, PAGE_SIZE);
+ ret = page->mapping->a_ops->prepare_write(bitmap->file, page, 0, PAGE_SIZE);
if (!ret)
- ret = page->mapping->a_ops->commit_write(NULL, page, 0,
+ ret = page->mapping->a_ops->commit_write(bitmap->file, page, 0,
PAGE_SIZE);
if (ret) {
unlock_page(page);
-
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/