aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorFlorian Albrechtskirchinger <falbrechtskirchinger@gmail.com>2012-02-10 16:15:54 -0500
committerDavid Sterba <dsterba@suse.cz>2012-02-16 10:35:41 -0500
commit12fc9d0923ca70ae8960bccebac09d5c12f8c4d4 (patch)
tree996a0e13d8e15e374144fa4f3d15680e0eada5b1 /fs/btrfs
parent8a3344269465b26761b74493cfbeeaa75d821614 (diff)
btrfs: honor umask when creating subvol root
Set the subvol root inode permissions based on the current umask.
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/inode.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index bf392e532617..6e0ee9b0d742 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -6706,8 +6706,10 @@ int btrfs_create_subvol_root(struct btrfs_trans_handle *trans,
6706 int err; 6706 int err;
6707 u64 index = 0; 6707 u64 index = 0;
6708 6708
6709 inode = btrfs_new_inode(trans, new_root, NULL, "..", 2, new_dirid, 6709 inode = btrfs_new_inode(trans, new_root, NULL, "..", 2,
6710 new_dirid, S_IFDIR | 0700, &index); 6710 new_dirid, new_dirid,
6711 S_IFDIR | (~current_umask() & S_IRWXUGO),
6712 &index);
6711 if (IS_ERR(inode)) 6713 if (IS_ERR(inode))
6712 return PTR_ERR(inode); 6714 return PTR_ERR(inode);
6713 inode->i_op = &btrfs_dir_inode_operations; 6715 inode->i_op = &btrfs_dir_inode_operations;