]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix permissions of empty files not affected by umask
authorFilipe Brandenburger <filbranden@google.com>
Fri, 30 Nov 2012 03:40:08 +0000 (03:40 +0000)
committerChris Mason <chris.mason@fusionio.com>
Mon, 17 Dec 2012 01:46:28 +0000 (20:46 -0500)
commit938fa3b760fd4490f84d000f1a5c18f7069d30a3
tree33ec92228186bbb37215a7e8db2c2a4519b102ad
parent19e13514e62dac0e1e2e4afc979b1054894a4e43
Btrfs: fix permissions of empty files not affected by umask

When a new file is created with btrfs_create(), the inode will initially be
created with permissions 0666 and later on in btrfs_init_acl() it will be
adapted to mask out the umask bits. The problem is that this change won't make
it into the btrfs_inode unless there's another change to the inode (e.g. writing
content changing the size or touching the file changing the mtime.)

This fix adds a call to btrfs_update_inode() to btrfs_create() to make sure that
the change will not get lost if the in-memory inode is flushed before other
changes are made to the file.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/inode.c