aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorBadari Pulavarty <pbadari@us.ibm.com>2006-03-11 06:27:14 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-11 12:19:34 -0500
commitcd6ef84e6ac9454080707f2f338360f5d7e556fc (patch)
tree98770b47dd7ae2e1faad4796eb03b2d4760e1b03 /fs
parent0adb25d2e71ab047423d6fc63d5d184590d0a66f (diff)
[PATCH] ext3: fix nobh mode for chattr +j inodes
One can do "chattr +j" on a file to change its journalling mode. Fix writeback mode with "nobh" handling for it. Even though, we mount ext3 filesystem in writeback mode with "nobh" option, some one can do "chattr +j" on a single file to force it to do journalled mode. In order to do journaling, ext3_block_truncate_page() need to fallback to default case of creating buffers and adding them to transaction etc. Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext3/inode.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index 3fc4238e970..0384e539b88 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -1624,15 +1624,14 @@ static int ext3_block_truncate_page(handle_t *handle, struct page *page,
1624 * For "nobh" option, we can only work if we don't need to 1624 * For "nobh" option, we can only work if we don't need to
1625 * read-in the page - otherwise we create buffers to do the IO. 1625 * read-in the page - otherwise we create buffers to do the IO.
1626 */ 1626 */
1627 if (!page_has_buffers(page) && test_opt(inode->i_sb, NOBH)) { 1627 if (!page_has_buffers(page) && test_opt(inode->i_sb, NOBH) &&
1628 if (PageUptodate(page)) { 1628 ext3_should_writeback_data(inode) && PageUptodate(page)) {
1629 kaddr = kmap_atomic(page, KM_USER0); 1629 kaddr = kmap_atomic(page, KM_USER0);
1630 memset(kaddr + offset, 0, length); 1630 memset(kaddr + offset, 0, length);
1631 flush_dcache_page(page); 1631 flush_dcache_page(page);
1632 kunmap_atomic(kaddr, KM_USER0); 1632 kunmap_atomic(kaddr, KM_USER0);
1633 set_page_dirty(page); 1633 set_page_dirty(page);
1634 goto unlock; 1634 goto unlock;
1635 }
1636 } 1635 }
1637 1636
1638 if (!page_has_buffers(page)) 1637 if (!page_has_buffers(page))