Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH] Drop dirty roots created by log replay immediately when mount -o ro
@ 2008-11-20  5:52 Yan Zheng
  0 siblings, 0 replies; only message in thread
From: Yan Zheng @ 2008-11-20  5:52 UTC (permalink / raw)
  To: linux-btrfs

Hello,

The log replay products 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>

---
diff -urp 1/fs/btrfs/disk-io.c 2/fs/btrfs/disk-io.c
--- 1/fs/btrfs/disk-io.c	2008-11-20 10:17:50.000000000 +0800
+++ 2/fs/btrfs/disk-io.c	2008-11-20 12:24:36.000000000 +0800
@@ -1756,6 +1756,11 @@ struct btrfs_root *open_ctree(struct sup
 						      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)) {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-20  5:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-20  5:52 [PATCH] Drop dirty roots created by log replay immediately when mount -o ro Yan Zheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox