提交 2d13d8d0 编写于 作者: C Chris Mason 提交者: David Woodhouse

Btrfs: detect duplicate subvol names

Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 2619ba1f
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册