summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorFlorian Albrechtskirchinger <falbrechtskirchinger@gmail.com>2012-02-10 22:15:54 +0100
committerDavid Sterba <dsterba@suse.cz>2012-02-16 16:35:41 +0100
commit12fc9d0923ca70ae8960bccebac09d5c12f8c4d4 (patch)
tree996a0e13d8e15e374144fa4f3d15680e0eada5b1 /fs
parent8a3344269465b26761b74493cfbeeaa75d821614 (diff)
downloadop-kernel-dev-12fc9d0923ca70ae8960bccebac09d5c12f8c4d4.zip
op-kernel-dev-12fc9d0923ca70ae8960bccebac09d5c12f8c4d4.tar.gz
btrfs: honor umask when creating subvol root
Set the subvol root inode permissions based on the current umask.
Diffstat (limited to 'fs')
-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 bf392e5..6e0ee9b 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;
OpenPOWER on IntegriCloud