diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-11-17 21:14:24 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-11-17 21:14:24 -0500 |
commit | ea9e8b11bd1252dcbc23afefcf1a52ec6aa3c113 (patch) | |
tree | 3573c8d79e1936e8c921a3be77abda35124e0d78 /fs/btrfs/ctree.h | |
parent | 0660b5af3f7ac0fac69de975914e1f4a3a586fb3 (diff) |
Btrfs: prevent loops in the directory tree when creating snapshots
For a directory tree:
/mnt/subvolA/subvolB
btrfsctl -s /mnt/subvolA/subvolB /mnt
Will create a directory loop with subvolA under subvolB. This
commit uses the forward refs for each subvol and snapshot to error out
before creating the loop.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index ad2cbe63503c..70b3dbb4de12 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -1801,6 +1801,9 @@ int btrfs_drop_subtree(struct btrfs_trans_handle *trans, | |||
1801 | struct extent_buffer *node, | 1801 | struct extent_buffer *node, |
1802 | struct extent_buffer *parent); | 1802 | struct extent_buffer *parent); |
1803 | /* root-item.c */ | 1803 | /* root-item.c */ |
1804 | int btrfs_find_root_ref(struct btrfs_root *tree_root, | ||
1805 | struct btrfs_path *path, | ||
1806 | u64 root_id, u64 ref_id); | ||
1804 | int btrfs_add_root_ref(struct btrfs_trans_handle *trans, | 1807 | int btrfs_add_root_ref(struct btrfs_trans_handle *trans, |
1805 | struct btrfs_root *tree_root, | 1808 | struct btrfs_root *tree_root, |
1806 | u64 root_id, u8 type, u64 ref_id, | 1809 | u64 root_id, u8 type, u64 ref_id, |