linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs:  fix a bug of inheriting default ACL from parent
@ 2015-01-24  9:06 Kinglong Mee
  2015-01-26 12:11 ` [f2fs-dev] " Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Kinglong Mee @ 2015-01-24  9:06 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-f2fs-devel, linux-fsdevel

Introduced by a6dda0e63e97122ce9e0ba04367e37cca28315fa
"f2fs: use generic posix ACL infrastructure".

When testing default acl, gets in recent kernel (3.19.0-rc5),
# setfacl -dm g:root:rwx test/
# getfacl test/
# file: test/
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
default:user::rwx
default:group::r-x
default:group:root:rwx
default:mask::rwx
default:other::r-x

# cd test/
# mkdir testdir
]# getfacl testdir/
# file: testdir/
# owner: root
# group: root
user::rwx
group::rwx
                // missing an acl "group:root:rwx" inherited from parent
other::r-x
default:user::rwx
default:group::r-x
default:group:root:rwx
default:mask::rwx
default:other::r-x

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 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 1ccb26b..b0b23578 100644
--- a/fs/f2fs/acl.c
+++ b/fs/f2fs/acl.c
@@ -396,7 +396,7 @@ int f2fs_init_acl(struct inode *inode, struct inode 
*dir, struct page *ipage,
 		posix_acl_release(default_acl);
 	}
 	if (acl) {
-		if (error)
+		if (!error)
 			error = __f2fs_set_acl(inode, ACL_TYPE_ACCESS, acl,
 					       ipage);
 		posix_acl_release(acl);
-- 
2.1.0


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

* RE: [f2fs-dev] [PATCH] f2fs: fix a bug of inheriting default ACL from parent
  2015-01-24  9:06 [PATCH] f2fs: fix a bug of inheriting default ACL from parent Kinglong Mee
@ 2015-01-26 12:11 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2015-01-26 12:11 UTC (permalink / raw)
  To: 'Kinglong Mee', 'Jaegeuk Kim'
  Cc: linux-fsdevel, linux-f2fs-devel

Hi Kinglong,

Nice catch!

> -----Original Message-----
> From: Kinglong Mee [mailto:kinglongmee@gmail.com]
> Sent: Saturday, January 24, 2015 5:06 PM
> To: Jaegeuk Kim
> Cc: linux-fsdevel@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net
> Subject: [f2fs-dev] [PATCH] f2fs: fix a bug of inheriting default ACL from parent
> 
> Introduced by a6dda0e63e97122ce9e0ba04367e37cca28315fa
> "f2fs: use generic posix ACL infrastructure".
> 
> When testing default acl, gets in recent kernel (3.19.0-rc5),
> # setfacl -dm g:root:rwx test/
> # getfacl test/
> # file: test/
> # owner: root
> # group: root
> user::rwx
> group::r-x
> other::r-x
> default:user::rwx
> default:group::r-x
> default:group:root:rwx
> default:mask::rwx
> default:other::r-x
> 
> # cd test/
> # mkdir testdir
> ]# getfacl testdir/
> # file: testdir/
> # owner: root
> # group: root
> user::rwx
> group::rwx

Should be group::r-x?

>                 // missing an acl "group:root:rwx" inherited from parent

mask::rwx is missing too.

> other::r-x
> default:user::rwx
> default:group::r-x
> default:group:root:rwx
> default:mask::rwx
> default:other::r-x
> 
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>

Reviewed-by: Chao Yu <chao2.yu@samsung.com>

> ---
>  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 1ccb26b..b0b23578 100644
> --- a/fs/f2fs/acl.c
> +++ b/fs/f2fs/acl.c
> @@ -396,7 +396,7 @@ int f2fs_init_acl(struct inode *inode, struct inode
> *dir, struct page *ipage,
>  		posix_acl_release(default_acl);
>  	}
>  	if (acl) {
> -		if (error)
> +		if (!error)
>  			error = __f2fs_set_acl(inode, ACL_TYPE_ACCESS, acl,
>  					       ipage);
>  		posix_acl_release(acl);
> --
> 2.1.0
> 
> 
> ------------------------------------------------------------------------------
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> http://p.sf.net/sfu/gigenet
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


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

end of thread, other threads:[~2015-01-26 12:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-24  9:06 [PATCH] f2fs: fix a bug of inheriting default ACL from parent Kinglong Mee
2015-01-26 12:11 ` [f2fs-dev] " Chao Yu

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).