From: Gang He Date: Fri, 7 Aug 2020 06:17:56 +0000 (-0700) Subject: ocfs2: fix remounting needed after setfacl command X-Git-Tag: v5.15~3161^2~146 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=504ec37dfdfbf9c65166c51f7b12126d2a9b18dc;p=platform%2Fkernel%2Flinux-starfive.git ocfs2: fix remounting needed after setfacl command When use setfacl command to change a file's acl, the user cannot get the latest acl information from the file via getfacl command, until remounting the file system. e.g. setfacl -m u:ivan:rw /ocfs2/ivan getfacl /ocfs2/ivan getfacl: Removing leading '/' from absolute path names file: ocfs2/ivan owner: root group: root user::rw- group::r-- mask::r-- other::r-- The latest acl record("u:ivan:rw") cannot be returned via getfacl command until remounting. Signed-off-by: Gang He Signed-off-by: Andrew Morton Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Jun Piao Link: http://lkml.kernel.org/r/20200717023751.9922-1-ghe@suse.com Signed-off-by: Linus Torvalds --- diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c index bb981ec..7b07f5d 100644 --- a/fs/ocfs2/acl.c +++ b/fs/ocfs2/acl.c @@ -256,6 +256,8 @@ static int ocfs2_set_acl(handle_t *handle, ret = ocfs2_xattr_set(inode, name_index, "", value, size, 0); kfree(value); + if (!ret) + set_cached_acl(inode, type, acl); return ret; }