aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/dir.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2018-03-20 17:11:44 +0100
committerMiklos Szeredi <mszeredi@redhat.com>2018-03-20 17:11:44 +0100
commitbf5c1898bf9e6d5ce9840743e8eccc74c14d16a4 (patch)
treef71108968a73ea12d9678424a101fcfce165f58c /fs/fuse/dir.c
parentfuse: honor AT_STATX_DONT_SYNC (diff)
downloadlinux-dev-bf5c1898bf9e6d5ce9840743e8eccc74c14d16a4.tar.xz
linux-dev-bf5c1898bf9e6d5ce9840743e8eccc74c14d16a4.zip
fuse: honor AT_STATX_FORCE_SYNC
Force a refresh of attributes from the fuse server in this case. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r--fs/fuse/dir.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index ef883f0bee8f..56231b31f806 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -928,9 +928,16 @@ static int fuse_update_get_attr(struct inode *inode, struct file *file,
{
struct fuse_inode *fi = get_fuse_inode(inode);
int err = 0;
+ bool sync;
- if (!(flags & AT_STATX_DONT_SYNC) &&
- time_before64(fi->i_time, get_jiffies_64())) {
+ if (flags & AT_STATX_FORCE_SYNC)
+ sync = true;
+ else if (flags & AT_STATX_DONT_SYNC)
+ sync = false;
+ else
+ sync = time_before64(fi->i_time, get_jiffies_64());
+
+ if (sync) {
forget_all_cached_acls(inode);
err = fuse_do_getattr(inode, stat, file);
} else if (stat) {