f2fs: Don't clear SGID when inheriting ACLs
Subsystems (3)
Jaegeuk Kim
maintainerPATCH 1/1 f2fs: Don't clear SGID when inheriting ACLs
This patch copies commit b7f8a09f80:
"btrfs: Don't clear SGID when inheriting ACLs" written by Jan.
--- fs/f2fs/acl.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
fs/f2fs/acl.c +8 -5
@@ -211,12 +211,8 @@ static int __f2fs_set_acl(struct inode *inode, int type,switch (type) {case ACL_TYPE_ACCESS : name_index =F2FS_XATTR_INDEX_POSIX_ACL_ACCESS ; -if (acl) { - error =posix_acl_update_mode (inode, &inode->i_mode, &acl); -if (error) -return error; +if (acl)set_acl_inode (inode, inode->i_mode); - }break ;case ACL_TYPE_DEFAULT :
@@ -249,6 +245,13 @@ static int __f2fs_set_acl(struct inode *inode, int type,int f2fs_set_acl (struct inode *inode,struct posix_acl *acl,int type) { +int ret; + +if (type ==ACL_TYPE_ACCESS && acl) { + ret =posix_acl_update_mode (inode, &inode->i_mode, &acl); +if (ret) +return ret; + }return __f2fs_set_acl (inode, type, acl,NULL ); }
Signature · 1 line
2.13.0.rc1.294.g07d810a77f-goog
Jaegeuk Kim
maintainerThis patch copies commit b7f8a09f80:
"btrfs: Don't clear SGID when inheriting ACLs" written by Jan.
---
Change log from v1:
- fix for simple change
fs/f2fs/acl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/acl.c +1 -1
@@ -211,7 +211,7 @@ static int __f2fs_set_acl(struct inode *inode, int type,switch (type) {case ACL_TYPE_ACCESS : name_index =F2FS_XATTR_INDEX_POSIX_ACL_ACCESS ; -if (acl) { +if (acl && !ipage) { error =posix_acl_update_mode (inode, &inode->i_mode, &acl);if (error)return error;
Signature · 1 line
2.13.0.rc1.294.g07d810a77f-goog
Quoted 7 lines · Jaegeuk Kim
This patch copies commit
b7f8a09f80:
"btrfs: Don't clear SGID when inheriting ACLs" written by Jan.Fixes 073931017b49d9458aa351605b43a7e34598caefSigned-off-by Jan Kara <[email protected]>Signed-off-by Jaegeuk Kim <[email protected]>
Thanks,
Quoted 22 lines
---
Change log from v1:
- fix for simple changefs/f2fs/acl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/f2fs/acl.c +1
-1@@ -211,7 +211,7 @@ static int __f2fs_set_acl(struct inode *inode, int type,switch (type) {case ACL_TYPE_ACCESS : name_index =F2FS_XATTR_INDEX_POSIX_ACL_ACCESS ; -if (acl) { +if (acl && !ipage) { error =posix_acl_update_mode (inode, &inode->i_mode, &acl);if (error)return error;
Quoted 7 lines · Jaegeuk Kim
This patch copies commit
b7f8a09f80:
"btrfs: Don't clear SGID when inheriting ACLs" written by Jan.Fixes 073931017b49d9458aa351605b43a7e34598caefSigned-off-by Jan Kara <[email protected]>Signed-off-by Jaegeuk Kim <[email protected]>
Ah, somehow I've missed f2fs when going through filesystems that needed fixing up. Thanks for catching that. The patch looks good to me. It would just look a bit cleaner to me to move posix_acl_update_mode() call out of __f2fs_set_acl() into f2fs_set_acl() similarly as we do in other filesystems. But whatever, you are the maintainer ;) Feel free to add:
Honza
Quoted 25 lines
---
Change log from v1:
- fix for simple changefs/f2fs/acl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/f2fs/acl.c +1
-1@@ -211,7 +211,7 @@ static int __f2fs_set_acl(struct inode *inode, int type,switch (type) {case ACL_TYPE_ACCESS : name_index =F2FS_XATTR_INDEX_POSIX_ACL_ACCESS ; -if (acl) { +if (acl && !ipage) { error =posix_acl_update_mode (inode, &inode->i_mode, &acl);if (error)return error;Signature · 1 line
2.13.0.rc1.294.g07d810a77f-goog
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR