mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
btrfs: honor umask when creating subvol root
Set the subvol root inode permissions based on the current umask.
This commit is contained in:
parent
8a33442694
commit
12fc9d0923
1 changed files with 4 additions and 2 deletions
|
@ -6706,8 +6706,10 @@ int btrfs_create_subvol_root(struct btrfs_trans_handle *trans,
|
|||
int err;
|
||||
u64 index = 0;
|
||||
|
||||
inode = btrfs_new_inode(trans, new_root, NULL, "..", 2, new_dirid,
|
||||
new_dirid, S_IFDIR | 0700, &index);
|
||||
inode = btrfs_new_inode(trans, new_root, NULL, "..", 2,
|
||||
new_dirid, new_dirid,
|
||||
S_IFDIR | (~current_umask() & S_IRWXUGO),
|
||||
&index);
|
||||
if (IS_ERR(inode))
|
||||
return PTR_ERR(inode);
|
||||
inode->i_op = &btrfs_dir_inode_operations;
|
||||
|
|
Loading…
Reference in a new issue