If it is moved earlier it will have the effect of throwing away these pages even if the copychunk fails (and thus if the collapse range fails we end up still discarding). Any thoughts? On Sat, Aug 20, 2022 at 10:23 AM David Howells <dhowells@xxxxxxxxxx> wrote: > > Steve French <smfrench@xxxxxxxxx> wrote: > > > + truncate_pagecache_range(inode, off, old_eof); > > Upon further consideration, I think this should perhaps be before: > > > rc = smb2_copychunk_range(xid, cfile, cfile, off + len, > > so that any outstanding shared-writable mmap can be made to wait. > > Also the invalidation in smb3_zero_range() only covers the hole, so > smb3_insert_range() also needs to invalidate from the bottom of the hole to > the EOF - and, again, I think it needs to do this before making changes to the > file contents. > > David > -- Thanks, Steve