[PATCH] ext3 nobh cleanups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

One can do "chattr +j" on a file to change its journalling mode.
Here is the patch to fix writeback mode with "nobh" handling for it.

Thanks,
Badari

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 transcation etc. 

Signed-off-by: Badari Pulavarty <[email protected]>
Index: linux-2.6.16-rc5/fs/ext3/inode.c
===================================================================
--- linux-2.6.16-rc5.orig/fs/ext3/inode.c	2006-03-10 10:19:14.000000000
-0800
+++ linux-2.6.16-rc5/fs/ext3/inode.c	2006-03-10 10:40:43.000000000 -0800
@@ -1624,15 +1624,14 @@ static int ext3_block_truncate_page(hand
 	 * For "nobh" option,  we can only work if we don't need to
 	 * read-in the page - otherwise we create buffers to do the IO.
 	 */
-	if (!page_has_buffers(page) && test_opt(inode->i_sb, NOBH)) {
-		if (PageUptodate(page)) {
+	if (!page_has_buffers(page) && test_opt(inode->i_sb, NOBH) &&
+	     ext3_should_writeback_data(inode) && PageUptodate(page)) {
 			kaddr = kmap_atomic(page, KM_USER0);
 			memset(kaddr + offset, 0, length);
 			flush_dcache_page(page);
 			kunmap_atomic(kaddr, KM_USER0);
 			set_page_dirty(page);
 			goto unlock;
-		}
 	}
 
 	if (!page_has_buffers(page))


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux