summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--disk-io.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/disk-io.c b/disk-io.c
index 06815728..3caf3a03 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -293,6 +293,9 @@ static int commit_tree_roots(struct btrfs_trans_handle *trans,
struct list_head *next;
struct extent_buffer *eb;
+ if (fs_info->readonly)
+ return 0;
+
eb = fs_info->tree_root->node;
extent_buffer_get(eb);
btrfs_cow_block(trans, fs_info->tree_root, eb, NULL, 0, &eb);