afs: Skip truncation on the server of data we haven't written yet
authorDavid Howells <dhowells@redhat.com>
Wed, 22 Jul 2020 09:44:34 +0000 (10:44 +0100)
committerDavid Howells <dhowells@redhat.com>
Fri, 7 Jan 2022 13:44:56 +0000 (13:44 +0000)
commit0770bd4187c555e6df087f7abc252eeacb0842ec
tree5959a09dd6c491363d0bdb2b31e00889e245ac04
parentc7f75ef33b6dcd4269d0f6ee8c50221ee3390733
afs: Skip truncation on the server of data we haven't written yet

Don't send a truncation RPC to the server if we're only shortening data
that's in the pagecache and is beyond the server's EOF.

Also don't automatically force writeback on setattr, but do wait to store
RPCs that are in the region to be removed on a shortening truncation.

Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: kafs-testing@auristor.com
Acked-by: Jeff Layton <jlayton@kernel.org>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/r/163819663275.215744.4781075713714590913.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/163906972600.143852.14237659724463048094.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/163967177522.1823006.15336589054269480601.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/164021571880.640689.1837025861707111004.stgit@warthog.procyon.org.uk/
fs/afs/inode.c