[PATCH v3] btrfs: preserve i_mode if __btrfs_set_acl() fails

2017-08-02 Thread Ernesto A . Fernández
with, the system will from now on assume that the mask permission bits are actual group permission bits, potentially granting access to the wrong users. Prevent this by restoring the original mode bits if __btrfs_set_acl fails. Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernan...@gmail.

[PATCH v2] btrfs: preserve i_mode if __btrfs_set_acl() fails

2017-07-29 Thread Ernesto A . Fernández
. Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernan...@gmail.com> --- Changes in v2: - Take the code that checks if we are setting a default acl on something that is not a dir, remove it from the __btrfs_set_acl function, and place it in btrfs_set_acl instead. This should fix the

Re: [PATCH] btrfs: preserve i_mode if __btrfs_set_acl() fails

2017-07-28 Thread Ernesto A . Fernández
On Sat, Jul 29, 2017 at 12:48:04AM +, Josef Bacik wrote: > On Fri, Jul 28, 2017 at 09:26:29PM -0300, Ernesto A. Fernández wrote: > > + ret = __btrfs_set_acl(trans, inode, acl, type); > > + if (ret) > > + goto out; > > + > > + inode->i_mod

[PATCH] btrfs: preserve i_mode if __btrfs_set_acl() fails

2017-07-28 Thread Ernesto A . Fernández
. Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernan...@gmail.com> --- This issue is covered by generic/449 in xfstests. Several filesystems are affected; some of them have already applied patches: - fe26569 ext2: preserve i_mode if ext2_set_acl() fails - f070e5a jfs: preserve