aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2018-03-20 12:11:44 -0400
committerMiklos Szeredi <mszeredi@redhat.com>2018-03-20 12:11:44 -0400
commitff1b89f389a8e64d0a583ce0b0308696f4ab5860 (patch)
tree5a544ca640bfdaa563743af3f4f7669fc34e16bf
parent73f03c2b4b527346778c711c2734dbff3442b139 (diff)
fuse: honor AT_STATX_DONT_SYNC
The description of this flag says "Don't sync attributes with the server". In other words: always use the attributes cached in the kernel and don't send network or local messages to refresh the attributes. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
-rw-r--r--fs/fuse/dir.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index fa4009761a7a..ef883f0bee8f 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -924,12 +924,13 @@ static int fuse_do_getattr(struct inode *inode, struct kstat *stat,
924} 924}
925 925
926static int fuse_update_get_attr(struct inode *inode, struct file *file, 926static int fuse_update_get_attr(struct inode *inode, struct file *file,
927 struct kstat *stat) 927 struct kstat *stat, unsigned int flags)
928{ 928{
929 struct fuse_inode *fi = get_fuse_inode(inode); 929 struct fuse_inode *fi = get_fuse_inode(inode);
930 int err = 0; 930 int err = 0;
931 931
932 if (time_before64(fi->i_time, get_jiffies_64())) { 932 if (!(flags & AT_STATX_DONT_SYNC) &&
933 time_before64(fi->i_time, get_jiffies_64())) {
933 forget_all_cached_acls(inode); 934 forget_all_cached_acls(inode);
934 err = fuse_do_getattr(inode, stat, file); 935 err = fuse_do_getattr(inode, stat, file);
935 } else if (stat) { 936 } else if (stat) {
@@ -943,7 +944,7 @@ static int fuse_update_get_attr(struct inode *inode, struct file *file,
943 944
944int fuse_update_attributes(struct inode *inode, struct file *file) 945int fuse_update_attributes(struct inode *inode, struct file *file)
945{ 946{
946 return fuse_update_get_attr(inode, file, NULL); 947 return fuse_update_get_attr(inode, file, NULL, 0);
947} 948}
948 949
949int fuse_reverse_inval_entry(struct super_block *sb, u64 parent_nodeid, 950int fuse_reverse_inval_entry(struct super_block *sb, u64 parent_nodeid,
@@ -1794,7 +1795,7 @@ static int fuse_getattr(const struct path *path, struct kstat *stat,
1794 if (!fuse_allow_current_process(fc)) 1795 if (!fuse_allow_current_process(fc))
1795 return -EACCES; 1796 return -EACCES;
1796 1797
1797 return fuse_update_get_attr(inode, NULL, stat); 1798 return fuse_update_get_attr(inode, NULL, stat, flags);
1798} 1799}
1799 1800
1800static const struct inode_operations fuse_dir_inode_operations = { 1801static const struct inode_operations fuse_dir_inode_operations = {