diff options
author | Badari Pulavarty <pbadari@us.ibm.com> | 2006-11-17 17:47:22 +0100 |
---|---|---|
committer | Adrian Bunk <bunk@stusta.de> | 2006-11-17 17:47:22 +0100 |
commit | 770af3b42ad36c622586eee13db3799837567102 (patch) | |
tree | 99c21c1e92fc8ccd0fae10bad236b92c82394f39 /fs/ext3 | |
parent | 39a2b41be778a3d075bd52925c1967744ad5093f (diff) | |
download | linux-stable-770af3b42ad36c622586eee13db3799837567102.tar.gz linux-stable-770af3b42ad36c622586eee13db3799837567102.tar.bz2 linux-stable-770af3b42ad36c622586eee13db3799837567102.zip |
ext3 -nobh option causes oops
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>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Diffstat (limited to 'fs/ext3')
-rw-r--r-- | fs/ext3/inode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index cbad292b4c36..4fafef3c511f 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c @@ -1005,7 +1005,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); @@ -1093,7 +1093,7 @@ static int ext3_writeback_commit_write(struct file *file, struct page *page, 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); @@ -1343,7 +1343,7 @@ static int ext3_writeback_writepage(struct page *page, 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); |