From: Miao Xie <miaox@cn.fujitsu.com>
To: Chris Mason <chris.mason@oracle.com>, Josef Bacik <josef@redhat.com>
Cc: Linux Btrfs <linux-btrfs@vger.kernel.org>,
Liu Bo <liubo2009@cn.fujitsu.com>
Subject: [RFC PATCH 2/4] Btrfs: add MS_RDONLY to avoid backgroud writeback
Date: Thu, 25 Nov 2010 17:54:32 +0800 [thread overview]
Message-ID: <4CEE3258.2090302@cn.fujitsu.com> (raw)
From: Liu Bo <liubo2009@cn.fujitsu.com>
When the filesystem is readonly, commit transaction is forbiddened.
Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
fs/btrfs/transaction.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 1fffbc0..45c76b9 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1188,6 +1188,13 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
unsigned long now = get_seconds();
int flush_on_commit = btrfs_test_opt(root, FLUSHONCOMMIT);
+ /*
+ * Since some error may force btrfs readonly, this can
+ * avoid backgroud writeback.
+ */
+ if (root->fs_info->sb->s_flags & MS_RDONLY)
+ return 0;
+
btrfs_run_ordered_operations(root, 0);
/* make a pass through all the delayed refs we have so far
--
1.7.0.1
reply other threads:[~2010-11-25 9:54 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=4CEE3258.2090302@cn.fujitsu.com \
--to=miaox@cn.fujitsu.com \
--cc=chris.mason@oracle.com \
--cc=josef@redhat.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=liubo2009@cn.fujitsu.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.