* [RFC PATCH 2/4] Btrfs: add MS_RDONLY to avoid backgroud writeback
@ 2010-11-25 9:54 Miao Xie
0 siblings, 0 replies; only message in thread
From: Miao Xie @ 2010-11-25 9:54 UTC (permalink / raw)
To: Chris Mason, Josef Bacik; +Cc: Linux Btrfs, Liu Bo
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-11-25 9:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-25 9:54 [RFC PATCH 2/4] Btrfs: add MS_RDONLY to avoid backgroud writeback Miao Xie
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.