Skip to content

Commit

Permalink
afs: Fix updating of i_size with dv jump from server
Browse files Browse the repository at this point in the history
[ Upstream commit d7f74e9 ]

If the data version returned from the server is larger than expected,
the local data is invalidated, but we may still want to note the remote
file size.

Since we're setting change_size, we have to also set data_changed
for the i_size to get updated.

Fixes: 3f4aa98 ("afs: Fix EOF corruption")
Signed-off-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-afs@lists.infradead.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Marc Dionne authored and gregkh committed May 11, 2023
1 parent f17d1bc commit 411c97c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/afs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ static void afs_apply_status(struct afs_operation *op,
set_bit(AFS_VNODE_ZAP_DATA, &vnode->flags);
}
change_size = true;
data_changed = true;
} else if (vnode->status.type == AFS_FTYPE_DIR) {
/* Expected directory change is handled elsewhere so
* that we can locally edit the directory and save on a
Expand Down

0 comments on commit 411c97c

Please sign in to comment.