aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs/inode.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2022-02-14 14:11:25 +0000
committerDavid Howells <dhowells@redhat.com>2022-03-18 09:29:05 +0000
commitab487a4cdfca3d1ef12795a49eafe1144967e617 (patch)
tree1f6ca8197dca199a98e23f798797dedfacf45edd /fs/afs/inode.c
parentnetfs: Keep track of the actual remote file size (diff)
downloadlinux-dev-ab487a4cdfca3d1ef12795a49eafe1144967e617.tar.xz
linux-dev-ab487a4cdfca3d1ef12795a49eafe1144967e617.zip
afs: Maintain netfs_i_context::remote_i_size
Make afs use netfslib's tracking for the server's idea of what the current inode size is independently of inode->i_size. We really want to use this value when calculating the new vnode size when initiating a StoreData RPC op rather than the size stat() presents to the user (ie. inode->i_size) as the latter is affected by as-yet uncommitted writes. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> cc: linux-cachefs@redhat.com cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/164623014626.3564931.8375344024648265358.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678220204.1200972.17408022517463940584.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692923592.2099075.5466132542956550401.stgit@warthog.procyon.org.uk/ # v3
Diffstat (limited to 'fs/afs/inode.c')
-rw-r--r--fs/afs/inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index 5b5e40197655..2fe402483ad5 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -246,6 +246,7 @@ static void afs_apply_status(struct afs_operation *op,
* idea of what the size should be that's not the same as
* what's on the server.
*/
+ vnode->netfs_ctx.remote_i_size = status->size;
if (change_size) {
afs_set_i_size(vnode, status->size);
inode->i_ctime = t;