diff options
author | Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com> | 2012-02-11 01:15:54 +0400 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2012-02-16 19:35:41 +0400 |
commit | 12fc9d0923ca70ae8960bccebac09d5c12f8c4d4 (patch) | |
tree | 996a0e13d8e15e374144fa4f3d15680e0eada5b1 | |
parent | 8a3344269465b26761b74493cfbeeaa75d821614 (diff) | |
download | linux-12fc9d0923ca70ae8960bccebac09d5c12f8c4d4.tar.xz |
btrfs: honor umask when creating subvol root
Set the subvol root inode permissions based on the current umask.
-rw-r--r-- | fs/btrfs/inode.c | 6 |
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, 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; |