From: Yan Zheng <zheng.yan@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] Drop dirty roots created by log replay immediately when mount -o ro
Date: Thu, 20 Nov 2008 13:52:57 +0800 [thread overview]
Message-ID: <4924FB39.3030502@oracle.com> (raw)
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)) {
reply other threads:[~2008-11-20 5:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4924FB39.3030502@oracle.com \
--to=zheng.yan@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox