public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext3 -nobh option causes oops (2.6.17.7)
@ 2006-07-27 20:42 Badari Pulavarty
  2006-08-03  7:13 ` [stable] " Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Badari Pulavarty @ 2006-07-27 20:42 UTC (permalink / raw)
  To: lkml, stable; +Cc: akpm

Hi Andrew,

ext3 -nobh option causes kernel oops on files other than IFREG -
since the modification to them are journalled anyway and the
code expects to have buffer_head attached to it.

We need this patch for stable series also.

Thanks,
Badari

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 <pbadari@us.ibm.com>

Index: linux-2.6.17.7/fs/ext3/inode.c
===================================================================
--- linux-2.6.17.7.orig/fs/ext3/inode.c	2006-07-24 20:36:01.000000000 -0700
+++ linux-2.6.17.7/fs/ext3/inode.c	2006-07-27 13:26:13.000000000 -0700
@@ -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);



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [stable] [PATCH] ext3 -nobh option causes oops (2.6.17.7)
  2006-07-27 20:42 [PATCH] ext3 -nobh option causes oops (2.6.17.7) Badari Pulavarty
@ 2006-08-03  7:13 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2006-08-03  7:13 UTC (permalink / raw)
  To: Badari Pulavarty; +Cc: lkml, stable, akpm

On Thu, Jul 27, 2006 at 01:42:41PM -0700, Badari Pulavarty wrote:
> Hi Andrew,
> 
> ext3 -nobh option causes kernel oops on files other than IFREG -
> since the modification to them are journalled anyway and the
> code expects to have buffer_head attached to it.
> 
> We need this patch for stable series also.
> 
> Thanks,
> Badari
> 
> 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 <pbadari@us.ibm.com>

Queued to -stable.

thanks,

greg k-h


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-03  7:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-27 20:42 [PATCH] ext3 -nobh option causes oops (2.6.17.7) Badari Pulavarty
2006-08-03  7:13 ` [stable] " Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox