@@ -1287,6 +1287,8 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off,
1287
1287
rc = cifs_flush_folio (target_inode , destend , & fstart , & fend , false);
1288
1288
if (rc )
1289
1289
goto unlock ;
1290
+ if (fend > target_cifsi -> netfs .zero_point )
1291
+ target_cifsi -> netfs .zero_point = fend + 1 ;
1290
1292
1291
1293
/* Discard all the folios that overlap the destination region. */
1292
1294
cifs_dbg (FYI , "about to discard pages %llx-%llx\n" , fstart , fend );
@@ -1305,6 +1307,8 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off,
1305
1307
fscache_resize_cookie (cifs_inode_cookie (target_inode ),
1306
1308
new_size );
1307
1309
}
1310
+ if (rc == 0 && new_size > target_cifsi -> netfs .zero_point )
1311
+ target_cifsi -> netfs .zero_point = new_size ;
1308
1312
}
1309
1313
1310
1314
/* force revalidate of size and timestamps of target file now
@@ -1396,6 +1400,8 @@ ssize_t cifs_file_copychunk_range(unsigned int xid,
1396
1400
rc = cifs_flush_folio (target_inode , destend , & fstart , & fend , false);
1397
1401
if (rc )
1398
1402
goto unlock ;
1403
+ if (fend > target_cifsi -> netfs .zero_point )
1404
+ target_cifsi -> netfs .zero_point = fend + 1 ;
1399
1405
1400
1406
/* Discard all the folios that overlap the destination region. */
1401
1407
truncate_inode_pages_range (& target_inode -> i_data , fstart , fend );
0 commit comments