Commit 12fc9d09 authored by Florian Albrechtskirchinger's avatar Florian Albrechtskirchinger Committed by David Sterba

btrfs: honor umask when creating subvol root

Set the subvol root inode permissions based on the current umask.
parent 8a334426
...@@ -6706,8 +6706,10 @@ int btrfs_create_subvol_root(struct btrfs_trans_handle *trans, ...@@ -6706,8 +6706,10 @@ int btrfs_create_subvol_root(struct btrfs_trans_handle *trans,
int err; int err;
u64 index = 0; u64 index = 0;
inode = btrfs_new_inode(trans, new_root, NULL, "..", 2, new_dirid, inode = btrfs_new_inode(trans, new_root, NULL, "..", 2,
new_dirid, S_IFDIR | 0700, &index); new_dirid, new_dirid,
S_IFDIR | (~current_umask() & S_IRWXUGO),
&index);
if (IS_ERR(inode)) if (IS_ERR(inode))
return PTR_ERR(inode); return PTR_ERR(inode);
inode->i_op = &btrfs_dir_inode_operations; inode->i_op = &btrfs_dir_inode_operations;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment