mirror of https://gitee.com/openkylin/linux.git
fuse: fix revalidation of attributes for permission check
fuse_invalidate_attr() now sets fi->inval_mask instead of fi->i_time, hence
we need to check the inval mask in fuse_permission() as well.
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Fixes: 2f1e81965f
("fuse: allow fine grained attr cache invaldation")
This commit is contained in:
parent
a9c2d1e82f
commit
d233c7dd16
|
@ -1119,8 +1119,10 @@ static int fuse_permission(struct inode *inode, int mask)
|
||||||
if (fc->default_permissions ||
|
if (fc->default_permissions ||
|
||||||
((mask & MAY_EXEC) && S_ISREG(inode->i_mode))) {
|
((mask & MAY_EXEC) && S_ISREG(inode->i_mode))) {
|
||||||
struct fuse_inode *fi = get_fuse_inode(inode);
|
struct fuse_inode *fi = get_fuse_inode(inode);
|
||||||
|
u32 perm_mask = STATX_MODE | STATX_UID | STATX_GID;
|
||||||
|
|
||||||
if (time_before64(fi->i_time, get_jiffies_64())) {
|
if (perm_mask & READ_ONCE(fi->inval_mask) ||
|
||||||
|
time_before64(fi->i_time, get_jiffies_64())) {
|
||||||
refreshed = true;
|
refreshed = true;
|
||||||
|
|
||||||
err = fuse_perm_getattr(inode, mask);
|
err = fuse_perm_getattr(inode, mask);
|
||||||
|
|
Loading…
Reference in New Issue