2006-11-16 22:51:55

by Adrian Bunk

[permalink] [raw]
Subject: Re: [patch 15/23] ext3 -nobh option causes oops

It seems this patch that went into 2.6.17.8 should also be included in
the 2.6.16.x branch, or do I miss anything?

TIA
Adrian


On Thu, Aug 03, 2006 at 10:40:03PM -0700, Greg KH wrote:
> -stable review patch. If anyone has any objections, please let us know.
>
> ------------------
> From: Badari Pulavarty <[email protected]>
>
> For files other than IFREG, nobh option doesn't make sense. Modifications
> to them are journalled and needs buffer heads to do that. Without this
> patch, we get kernel oops in page_buffers().
>
> Signed-off-by: Badari Pulavarty <[email protected]>
> Signed-off-by: Andrew Morton <[email protected]>
> Signed-off-by: Greg Kroah-Hartman <[email protected]>
>
> ---
> fs/ext3/inode.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> --- linux-2.6.17.7.orig/fs/ext3/inode.c
> +++ linux-2.6.17.7/fs/ext3/inode.c
> @@ -1159,7 +1159,7 @@ retry:
> ret = PTR_ERR(handle);
> goto out;
> }
> - if (test_opt(inode->i_sb, NOBH))
> + if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode))
> ret = nobh_prepare_write(page, from, to, ext3_get_block);
> else
> ret = block_prepare_write(page, from, to, ext3_get_block);
> @@ -1245,7 +1245,7 @@ static int ext3_writeback_commit_write(s
> if (new_i_size > EXT3_I(inode)->i_disksize)
> EXT3_I(inode)->i_disksize = new_i_size;
>
> - if (test_opt(inode->i_sb, NOBH))
> + if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode))
> ret = nobh_commit_write(file, page, from, to);
> else
> ret = generic_commit_write(file, page, from, to);
> @@ -1495,7 +1495,7 @@ static int ext3_writeback_writepage(stru
> goto out_fail;
> }
>
> - if (test_opt(inode->i_sb, NOBH))
> + if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode))
> ret = nobh_writepage(page, ext3_get_block, wbc);
> else
> ret = block_write_full_page(page, ext3_get_block, wbc);
>


2006-11-16 23:07:36

by Badari Pulavarty

[permalink] [raw]
Subject: Re: [patch 15/23] ext3 -nobh option causes oops


On Thu, 2006-11-16 at 23:51 +0100, Adrian Bunk wrote:
> It seems this patch that went into 2.6.17.8 should also be included in
> the 2.6.16.x branch, or do I miss anything?
>

Yes. This is needed for 2.6.16.x branch also.

Thanks,
Badari


> On Thu, Aug 03, 2006 at 10:40:03PM -0700, Greg KH wrote:
> > -stable review patch. If anyone has any objections, please let us know.
> >
> > ------------------
> > From: Badari Pulavarty <[email protected]>
> >
> > For files other than IFREG, nobh option doesn't make sense. Modifications
> > to them are journalled and needs buffer heads to do that. Without this
> > patch, we get kernel oops in page_buffers().
> >
> > Signed-off-by: Badari Pulavarty <[email protected]>
> > Signed-off-by: Andrew Morton <[email protected]>
> > Signed-off-by: Greg Kroah-Hartman <[email protected]>
> >
> > ---
> > fs/ext3/inode.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > --- linux-2.6.17.7.orig/fs/ext3/inode.c
> > +++ linux-2.6.17.7/fs/ext3/inode.c
> > @@ -1159,7 +1159,7 @@ retry:
> > ret = PTR_ERR(handle);
> > goto out;
> > }
> > - if (test_opt(inode->i_sb, NOBH))
> > + if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode))
> > ret = nobh_prepare_write(page, from, to, ext3_get_block);
> > else
> > ret = block_prepare_write(page, from, to, ext3_get_block);
> > @@ -1245,7 +1245,7 @@ static int ext3_writeback_commit_write(s
> > if (new_i_size > EXT3_I(inode)->i_disksize)
> > EXT3_I(inode)->i_disksize = new_i_size;
> >
> > - if (test_opt(inode->i_sb, NOBH))
> > + if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode))
> > ret = nobh_commit_write(file, page, from, to);
> > else
> > ret = generic_commit_write(file, page, from, to);
> > @@ -1495,7 +1495,7 @@ static int ext3_writeback_writepage(stru
> > goto out_fail;
> > }
> >
> > - if (test_opt(inode->i_sb, NOBH))
> > + if (test_opt(inode->i_sb, NOBH) && ext3_should_writeback_data(inode))
> > ret = nobh_writepage(page, ext3_get_block, wbc);
> > else
> > ret = block_write_full_page(page, ext3_get_block, wbc);
> >

2006-11-17 16:47:40

by Adrian Bunk

[permalink] [raw]
Subject: Re: [patch 15/23] ext3 -nobh option causes oops

On Thu, Nov 16, 2006 at 03:07:54PM -0800, Badari Pulavarty wrote:
>
> On Thu, 2006-11-16 at 23:51 +0100, Adrian Bunk wrote:
> > It seems this patch that went into 2.6.17.8 should also be included in
> > the 2.6.16.x branch, or do I miss anything?
> >
>
> Yes. This is needed for 2.6.16.x branch also.

Thanks, I've applied it.

> Thanks,
> Badari

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed