summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>2014-02-08 23:46:35 +0800
committerJosef Bacik <jbacik@fb.com>2014-03-10 15:16:34 -0400
commitbcbba5e6593281adc234938b42d3c3d3570335db (patch)
tree45e554aa301ef7315f0f9026bfaa431b560c5fda /fs/btrfs/inode.c
parent850a8cdffe41abec9e3319d7801c49eced0778a1 (diff)
downloadop-kernel-dev-bcbba5e6593281adc234938b42d3c3d3570335db.zip
op-kernel-dev-bcbba5e6593281adc234938b42d3c3d3570335db.tar.gz
Btrfs: skip readonly root for snapshot-aware defragment
Btrfs send is assuming readonly root won't change, let's skip readonly root. Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: Josef Bacik <jbacik@fb.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 5b892500..b88f622 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2240,6 +2240,11 @@ static noinline int relink_extent_backref(struct btrfs_path *path,
return PTR_ERR(root);
}
+ if (btrfs_root_readonly(root)) {
+ srcu_read_unlock(&fs_info->subvol_srcu, index);
+ return 0;
+ }
+
/* step 2: get inode */
key.objectid = backref->inum;
key.type = BTRFS_INODE_ITEM_KEY;
OpenPOWER on IntegriCloud