diff options
-rw-r--r-- | fs/btrfs/inode.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 168e8c040aab..da76cad92ecf 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -4462,6 +4462,10 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir, | |||
4462 | if (inode->i_nlink == 0) | 4462 | if (inode->i_nlink == 0) |
4463 | return -ENOENT; | 4463 | return -ENOENT; |
4464 | 4464 | ||
4465 | /* do not allow sys_link's with other subvols of the same device */ | ||
4466 | if (root->objectid != BTRFS_I(inode)->root->objectid) | ||
4467 | return -EPERM; | ||
4468 | |||
4465 | /* | 4469 | /* |
4466 | * 1 item for inode ref | 4470 | * 1 item for inode ref |
4467 | * 2 items for dir items | 4471 | * 2 items for dir items |