Skip to content

Commit

Permalink
Btrfs: detect duplicate subvol names
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason authored and David Woodhouse committed Apr 11, 2007
1 parent 2619ba1 commit 2d13d8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/btrfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1853,13 +1853,13 @@ static int btrfs_ioctl(struct inode *inode, struct file *filp, unsigned int
path = btrfs_alloc_path();
if (!path)
return -ENOMEM;
root_dirid = btrfs_root_dirid(
&root->fs_info->tree_root->root_item);
root_dirid = root->fs_info->sb->s_root->d_inode->i_ino,
mutex_lock(&root->fs_info->fs_mutex);
ret = btrfs_lookup_dir_item(NULL, root->fs_info->tree_root,
path, root_dirid,
vol_args.name, namelen, 0);
mutex_unlock(&root->fs_info->fs_mutex);
btrfs_free_path(path);
if (ret == 0)
return -EEXIST;

Expand Down

0 comments on commit 2d13d8d

Please sign in to comment.