@@ -1889,6 +1889,7 @@ int fuse_do_setattr(struct dentry *dentry, struct iattr *attr,
1889
1889
int err ;
1890
1890
bool trust_local_cmtime = is_wb ;
1891
1891
bool fault_blocked = false;
1892
+ u64 attr_version ;
1892
1893
1893
1894
if (!fc -> default_permissions )
1894
1895
attr -> ia_valid |= ATTR_FORCE ;
@@ -1973,6 +1974,8 @@ int fuse_do_setattr(struct dentry *dentry, struct iattr *attr,
1973
1974
if (fc -> handle_killpriv_v2 && !capable (CAP_FSETID ))
1974
1975
inarg .valid |= FATTR_KILL_SUIDGID ;
1975
1976
}
1977
+
1978
+ attr_version = fuse_get_attr_version (fm -> fc );
1976
1979
fuse_setattr_fill (fc , & args , inode , & inarg , & outarg );
1977
1980
err = fuse_simple_request (fm , & args );
1978
1981
if (err ) {
@@ -1998,6 +2001,14 @@ int fuse_do_setattr(struct dentry *dentry, struct iattr *attr,
1998
2001
/* FIXME: clear I_DIRTY_SYNC? */
1999
2002
}
2000
2003
2004
+ if (fi -> attr_version > attr_version ) {
2005
+ /*
2006
+ * Apply attributes, for example for fsnotify_change(), but set
2007
+ * attribute timeout to zero.
2008
+ */
2009
+ outarg .attr_valid = outarg .attr_valid_nsec = 0 ;
2010
+ }
2011
+
2001
2012
fuse_change_attributes_common (inode , & outarg .attr , NULL ,
2002
2013
ATTR_TIMEOUT (& outarg ),
2003
2014
fuse_get_cache_mask (inode ), 0 );
0 commit comments