diff options
author | Wang Shilong <wangsl.fnst@cn.fujitsu.com> | 2014-02-08 23:46:35 +0800 |
---|---|---|
committer | Josef Bacik <jbacik@fb.com> | 2014-03-10 15:16:34 -0400 |
commit | bcbba5e6593281adc234938b42d3c3d3570335db (patch) | |
tree | 45e554aa301ef7315f0f9026bfaa431b560c5fda /fs/btrfs/inode.c | |
parent | 850a8cdffe41abec9e3319d7801c49eced0778a1 (diff) |
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.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5b892500309..b88f6221b48 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; |