]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
ocfs2: fix remounting needed after setfacl command
authorGang He <ghe@suse.com>
Thu, 14 Oct 2021 13:51:00 +0000 (15:51 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 5 Nov 2021 08:12:52 +0000 (09:12 +0100)
BugLink: https://bugs.launchpad.net/bugs/1947161
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 <ghe@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Link: http://lkml.kernel.org/r/20200717023751.9922-1-ghe@suse.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 504ec37dfdfbf9c65166c51f7b12126d2a9b18dc)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
fs/ocfs2/acl.c

index bb981ec76456b40a17c5fdbfa91e8f33eaaf3635..7b07f5df3a299aa8ffa662a15785fe574e49a1eb 100644 (file)
@@ -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;
 }