+ make-ext3-mount-default-to-barrier=1.patch added to -mm tree

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

 



The patch titled

     make ext3 mount default to barrier=1

has been added to the -mm tree.  Its filename is

     make-ext3-mount-default-to-barrier=1.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: make ext3 mount default to barrier=1
From: Chris Mason <mason@xxxxxxxx>

Turn on barriers by default for ext3.  mount -o barrier=0 will turn them off. 
It also changes the ext3 fsync call to trigger a barrier when a commit isn't
done.

Signed-off-by: Chris Mason <mason@xxxxxxxx>
Cc: Jens Axboe <axboe@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---


diff -puN fs/ext3/fsync.c~make-ext3-mount-default-to-barrier=1 fs/ext3/fsync.c
--- a/fs/ext3/fsync.c~make-ext3-mount-default-to-barrier=1
+++ a/fs/ext3/fsync.c
@@ -27,6 +27,7 @@
 #include <linux/sched.h>
 #include <linux/writeback.h>
 #include <linux/jbd.h>
+#include <linux/blkdev.h>
 #include <linux/ext3_fs.h>
 #include <linux/ext3_jbd.h>
 
@@ -81,7 +82,10 @@ int ext3_sync_file(struct file * file, s
 			.sync_mode = WB_SYNC_ALL,
 			.nr_to_write = 0, /* sys_fsync did this */
 		};
+		journal_t *journal = EXT3_SB(inode->i_sb)->s_journal;
 		ret = sync_inode(inode, &wbc);
+		if (journal && (journal->j_flags & JFS_BARRIER))
+			blkdev_issue_flush(inode->i_sb->s_bdev, NULL);
 	}
 out:
 	return ret;
diff -puN fs/ext3/super.c~make-ext3-mount-default-to-barrier=1 fs/ext3/super.c
--- a/fs/ext3/super.c~make-ext3-mount-default-to-barrier=1
+++ a/fs/ext3/super.c
@@ -1427,6 +1427,8 @@ static int ext3_fill_super (struct super
 	sbi->s_resuid = le16_to_cpu(es->s_def_resuid);
 	sbi->s_resgid = le16_to_cpu(es->s_def_resgid);
 
+	/* enable barriers by default */
+	set_opt(sbi->s_mount_opt, BARRIER);
 	set_opt(sbi->s_mount_opt, RESERVATION);
 
 	if (!parse_options ((char *) data, sb, &journal_inum, &journal_devnum,
_

Patches currently in -mm which might be from mason@xxxxxxxx are

reiserfs-warn-about-the-useless-nolargeio-option.patch
make-reiserfs-default-to-barrier=flush.patch
make-ext3-mount-default-to-barrier=1.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux