summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorYan Zheng2008-11-20 16:25:19 +0100
committerChris Mason2008-11-20 16:25:19 +0100
commite556ce2c9d2163aea122e91a1512c9a110fece5d (patch)
treea9cc015cdaa47ab42b60525d1a4285cc723a21d7 /fs/btrfs/disk-io.c
parentBtrfs: compat code fixes (diff)
downloadkernel-qcow2-linux-e556ce2c9d2163aea122e91a1512c9a110fece5d.tar.gz
kernel-qcow2-linux-e556ce2c9d2163aea122e91a1512c9a110fece5d.tar.xz
kernel-qcow2-linux-e556ce2c9d2163aea122e91a1512c9a110fece5d.zip
Btrfs: Drop dirty roots created by log replay immediately when
The log replay produces dirty roots. These dirty roots should be dropped immediately if the fs is mounted as ro. Otherwise they can be added to the dirty root list again when remounting the fs as rw. Thank you, Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 981652233f70..fb04665e5005 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1757,6 +1757,11 @@ struct btrfs_root *open_ctree(struct super_block *sb,
generation + 1);
ret = btrfs_recover_log_trees(log_tree_root);
BUG_ON(ret);
+
+ if (sb->s_flags & MS_RDONLY) {
+ ret = btrfs_commit_super(tree_root);
+ BUG_ON(ret);
+ }
}
if (!(sb->s_flags & MS_RDONLY)) {