@@ -211,7 +211,7 @@ void fuse_finish_open(struct inode *inode, struct file *file)
211
211
i_size_write (inode , 0 );
212
212
spin_unlock (& fi -> lock );
213
213
truncate_pagecache (inode , 0 );
214
- fuse_invalidate_attr (inode );
214
+ fuse_invalidate_attr_mask (inode , FUSE_STATX_MODSIZE );
215
215
if (fc -> writeback_cache )
216
216
file_update_time (file );
217
217
} else if (!(ff -> open_flags & FOPEN_KEEP_CACHE )) {
@@ -515,7 +515,7 @@ static int fuse_flush(struct file *file, fl_owner_t id)
515
515
* enabled, i_blocks from cached attr may not be accurate.
516
516
*/
517
517
if (!err && fm -> fc -> writeback_cache )
518
- fuse_invalidate_attr (inode );
518
+ fuse_invalidate_attr_mask (inode , STATX_BLOCKS );
519
519
return err ;
520
520
}
521
521
@@ -1266,7 +1266,7 @@ static ssize_t fuse_perform_write(struct kiocb *iocb,
1266
1266
fuse_write_update_size (inode , pos );
1267
1267
1268
1268
clear_bit (FUSE_I_SIZE_UNSTABLE , & fi -> state );
1269
- fuse_invalidate_attr (inode );
1269
+ fuse_invalidate_attr_mask (inode , FUSE_STATX_MODSIZE );
1270
1270
1271
1271
return res > 0 ? res : err ;
1272
1272
}
@@ -1556,7 +1556,7 @@ static ssize_t fuse_direct_write_iter(struct kiocb *iocb, struct iov_iter *from)
1556
1556
FUSE_DIO_WRITE );
1557
1557
}
1558
1558
}
1559
- fuse_invalidate_attr (inode );
1559
+ fuse_invalidate_attr_mask (inode , FUSE_STATX_MODSIZE );
1560
1560
if (res > 0 )
1561
1561
fuse_write_update_size (inode , iocb -> ki_pos );
1562
1562
inode_unlock (inode );
@@ -1769,7 +1769,7 @@ static void fuse_writepage_end(struct fuse_mount *fm, struct fuse_args *args,
1769
1769
* is enabled, we trust local ctime/mtime.
1770
1770
*/
1771
1771
if (!fc -> writeback_cache )
1772
- fuse_invalidate_attr (inode );
1772
+ fuse_invalidate_attr_mask (inode , FUSE_STATX_MODIFY );
1773
1773
spin_lock (& fi -> lock );
1774
1774
rb_erase (& wpa -> writepages_entry , & fi -> writepages );
1775
1775
while (wpa -> next ) {
@@ -2875,7 +2875,7 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
2875
2875
2876
2876
if (iov_iter_rw (iter ) == WRITE ) {
2877
2877
ret = fuse_direct_io (io , iter , & pos , FUSE_DIO_WRITE );
2878
- fuse_invalidate_attr (inode );
2878
+ fuse_invalidate_attr_mask (inode , FUSE_STATX_MODSIZE );
2879
2879
} else {
2880
2880
ret = __fuse_direct_read (io , iter , & pos );
2881
2881
}
@@ -2996,7 +2996,7 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
2996
2996
if (mode & (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_ZERO_RANGE ))
2997
2997
truncate_pagecache_range (inode , offset , offset + length - 1 );
2998
2998
2999
- fuse_invalidate_attr (inode );
2999
+ fuse_invalidate_attr_mask (inode , FUSE_STATX_MODSIZE );
3000
3000
3001
3001
out :
3002
3002
if (!(mode & FALLOC_FL_KEEP_SIZE ))
@@ -3109,7 +3109,7 @@ static ssize_t __fuse_copy_file_range(struct file *file_in, loff_t pos_in,
3109
3109
file_update_time (file_out );
3110
3110
}
3111
3111
3112
- fuse_invalidate_attr (inode_out );
3112
+ fuse_invalidate_attr_mask (inode_out , FUSE_STATX_MODSIZE );
3113
3113
3114
3114
err = outarg .size ;
3115
3115
out :
0 commit comments