Btrfs: only write one super copy during fsync
authorChris Mason <chris.mason@oracle.com>
Tue, 13 Oct 2009 16:55:09 +0000 (12:55 -0400)
committerChris Mason <chris.mason@oracle.com>
Tue, 13 Oct 2009 17:35:11 +0000 (13:35 -0400)
During a tree-log commit for fsync, we've been writing at least
two copies of the super block and forcing them to disk.

The other filesystems write only one, and this change brings us on
par with them.  A full transaction commit will write all the super
copies, so we still have redundant info written on a regular
basis.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/tree-log.c

index 78f6254ac2d9ac7d1228c136087da2e695efdc9a..6d9ec285644d285a00ab9e581c7e63843edd4beb 100644 (file)
@@ -2092,7 +2092,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
         * the running transaction open, so a full commit can't hop
         * in and cause problems either.
         */
-       write_ctree_super(trans, root->fs_info->tree_root, 2);
+       write_ctree_super(trans, root->fs_info->tree_root, 1);
        ret = 0;
 
 out_wake_log_root: