]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: prevent loops in the directory tree when creating snapshots
authorChris Mason <chris.mason@oracle.com>
Tue, 18 Nov 2008 02:14:24 +0000 (21:14 -0500)
committerChris Mason <chris.mason@oracle.com>
Tue, 18 Nov 2008 02:14:24 +0000 (21:14 -0500)
commit1d1d80f45c72669a6dfc681a0311f865cab6acb2
tree3573c8d79e1936e8c921a3be77abda35124e0d78
parent1cba0ad5954f0caed132b970f92b39c7bd8e4eff
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>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/ioctl.c
fs/btrfs/root-tree.c