Skip to content

Commit 9c0f0a0

Browse files
Wengang-oracletorvalds
authored andcommitted
ocfs2: drop acl cache for directories too
ocfs2_data_convert_worker() is currently dropping any cached acl info for FILE before down-converting meta lock. It should also drop for DIRECTORY. Otherwise the second acl lookup returns the cached one (from VFS layer) which could be already stale. The problem we are seeing is that the acl changes on one node doesn't get refreshed on other nodes in the following case: Node 1 Node 2 -------------- ---------------- getfacl dir1 getfacl dir1 <-- this is OK setfacl -m u:user1:rwX dir1 getfacl dir1 <-- see the change for user1 getfacl dir1 <-- can't see change for user1 Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Wengang Wang <[email protected]> Reviewed-by: Joseph Qi <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Cc: Junxiao Bi <[email protected]> Cc: Changwei Ge <[email protected]> Cc: Gang He <[email protected]> Cc: Jun Piao <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent de6ee65 commit 9c0f0a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/ocfs2/dlmglue.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3951,7 +3951,7 @@ static int ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres,
39513951
oi = OCFS2_I(inode);
39523952
oi->ip_dir_lock_gen++;
39533953
mlog(0, "generation: %u\n", oi->ip_dir_lock_gen);
3954-
goto out;
3954+
goto out_forget;
39553955
}
39563956

39573957
if (!S_ISREG(inode->i_mode))
@@ -3982,6 +3982,7 @@ static int ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres,
39823982
filemap_fdatawait(mapping);
39833983
}
39843984

3985+
out_forget:
39853986
forget_all_cached_acls(inode);
39863987

39873988
out:

0 commit comments

Comments
 (0)