]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
afs: Fix getattr to report server i_size on dirs, not local size
authorDavid Howells <dhowells@redhat.com>
Tue, 6 Dec 2022 13:49:42 +0000 (13:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:11:32 +0000 (23:11 +0900)
commit7a543b72adf52bfa6af10984ae4bd51201ab4c23
tree3329335cb525a4a751d9f6def9b98bd5d0cae5df
parent213aca3e3041cd6c6ad2a179d0039f6ea75bf184
afs: Fix getattr to report server i_size on dirs, not local size

[ Upstream commit 45f66fa03ba9943cca5af88d691399332b8bde08 ]

Fix afs_getattr() to report the server's idea of the file size of a
directory rather than the local size.  The local size may differ as we edit
the local copy to avoid having to redownload it and we may end up with a
differently structured blob of a different size.

However, if the directory is discarded from the pagecache we then download
it again and the user may see the directory file size apparently change.

Fixes: 63a4681ff39c ("afs: Locally edit directory data for mkdir/create/unlink/...")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/afs/inode.c