linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: Don't clear SGID when inheriting ACLs
@ 2017-07-11 20:53 Jaegeuk Kim
  2017-07-11 23:31 ` [PATCH v2] " Jaegeuk Kim
  0 siblings, 1 reply; 4+ messages in thread
From: Jaegeuk Kim @ 2017-07-11 20:53 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-f2fs-devel
  Cc: Jaegeuk Kim, stable, Jan Kara

This patch copies commit b7f8a09f80:
  "btrfs: Don't clear SGID when inheriting ACLs" written by Jan.

Fixes: 073931017b49d9458aa351605b43a7e34598caef
CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/acl.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c
index a140c5e3dc54..da77352c5ad3 100644
--- a/fs/f2fs/acl.c
+++ b/fs/f2fs/acl.c
@@ -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);
 }
 
-- 
2.13.0.rc1.294.g07d810a77f-goog

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] f2fs: Don't clear SGID when inheriting ACLs
  2017-07-11 20:53 [PATCH] f2fs: Don't clear SGID when inheriting ACLs Jaegeuk Kim
@ 2017-07-11 23:31 ` Jaegeuk Kim
  2017-07-13  4:08   ` [f2fs-dev] " Chao Yu
  2017-07-13 15:19   ` Jan Kara
  0 siblings, 2 replies; 4+ messages in thread
From: Jaegeuk Kim @ 2017-07-11 23:31 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-f2fs-devel; +Cc: Jan Kara, stable

This patch copies commit b7f8a09f80:
"btrfs: Don't clear SGID when inheriting ACLs" written by Jan.

Fixes: 073931017b49d9458aa351605b43a7e34598caef
CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---

Change log from v1:
 - fix for simple change

 fs/f2fs/acl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c
index a140c5e3dc54..b4b8438c42ef 100644
--- a/fs/f2fs/acl.c
+++ b/fs/f2fs/acl.c
@@ -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;
-- 
2.13.0.rc1.294.g07d810a77f-goog



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [f2fs-dev] [PATCH v2] f2fs: Don't clear SGID when inheriting ACLs
  2017-07-11 23:31 ` [PATCH v2] " Jaegeuk Kim
@ 2017-07-13  4:08   ` Chao Yu
  2017-07-13 15:19   ` Jan Kara
  1 sibling, 0 replies; 4+ messages in thread
From: Chao Yu @ 2017-07-13  4:08 UTC (permalink / raw)
  To: Jaegeuk Kim, linux-kernel, linux-fsdevel, linux-f2fs-devel
  Cc: Jan Kara, stable

On 2017/7/12 7:31, Jaegeuk Kim wrote:
> This patch copies commit b7f8a09f80:
> "btrfs: Don't clear SGID when inheriting ACLs" written by Jan.
> 
> Fixes: 073931017b49d9458aa351605b43a7e34598caef
> CC: stable@vger.kernel.org
> Signed-off-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

> ---
> 
> Change log from v1:
>  - fix for simple change
> 
>  fs/f2fs/acl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c
> index a140c5e3dc54..b4b8438c42ef 100644
> --- a/fs/f2fs/acl.c
> +++ b/fs/f2fs/acl.c
> @@ -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;
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] f2fs: Don't clear SGID when inheriting ACLs
  2017-07-11 23:31 ` [PATCH v2] " Jaegeuk Kim
  2017-07-13  4:08   ` [f2fs-dev] " Chao Yu
@ 2017-07-13 15:19   ` Jan Kara
  1 sibling, 0 replies; 4+ messages in thread
From: Jan Kara @ 2017-07-13 15:19 UTC (permalink / raw)
  To: Jaegeuk Kim
  Cc: linux-kernel, linux-fsdevel, linux-f2fs-devel, stable, Jan Kara

On Tue 11-07-17 16:31:24, Jaegeuk Kim wrote:
> This patch copies commit b7f8a09f80:
> "btrfs: Don't clear SGID when inheriting ACLs" written by Jan.
> 
> Fixes: 073931017b49d9458aa351605b43a7e34598caef
> CC: stable@vger.kernel.org
> Signed-off-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

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:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza
> ---
> 
> Change log from v1:
>  - fix for simple change
> 
>  fs/f2fs/acl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c
> index a140c5e3dc54..b4b8438c42ef 100644
> --- a/fs/f2fs/acl.c
> +++ b/fs/f2fs/acl.c
> @@ -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;
> -- 
> 2.13.0.rc1.294.g07d810a77f-goog
> 
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-13 15:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-11 20:53 [PATCH] f2fs: Don't clear SGID when inheriting ACLs Jaegeuk Kim
2017-07-11 23:31 ` [PATCH v2] " Jaegeuk Kim
2017-07-13  4:08   ` [f2fs-dev] " Chao Yu
2017-07-13 15:19   ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).