Commit bcbba5e6 authored by Wang Shilong's avatar Wang Shilong Committed by Josef Bacik

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: default avatarWang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
parent 850a8cdf
...@@ -2240,6 +2240,11 @@ static noinline int relink_extent_backref(struct btrfs_path *path, ...@@ -2240,6 +2240,11 @@ static noinline int relink_extent_backref(struct btrfs_path *path,
return PTR_ERR(root); return PTR_ERR(root);
} }
if (btrfs_root_readonly(root)) {
srcu_read_unlock(&fs_info->subvol_srcu, index);
return 0;
}
/* step 2: get inode */ /* step 2: get inode */
key.objectid = backref->inum; key.objectid = backref->inum;
key.type = BTRFS_INODE_ITEM_KEY; key.type = BTRFS_INODE_ITEM_KEY;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment