Skip to content

Commit

Permalink
btrfs: honor umask when creating subvol root
Browse files Browse the repository at this point in the history
Set the subvol root inode permissions based on the current umask.
  • Loading branch information
Florian Albrechtskirchinger authored and David Sterba committed Feb 16, 2012
1 parent 8a33442 commit 12fc9d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 12fc9d0

Please sign in to comment.