kernel_optimize_test/fs/afs
David Howells 22538c1bde afs: Fix updating of i_blocks on file/dir extension
[ Upstream commit 9d37e1cab2a9d2cee2737973fa455e6f89eee46a ]

When an afs file or directory is modified locally such that the total file
size is extended, i_blocks needs to be recalculated too.

Fix this by making afs_write_end() and afs_edit_dir_add() call
afs_set_i_size() rather than setting inode->i_size directly as that also
recalculates inode->i_blocks.

This can be tested by creating and writing into directories and files and
then examining them with du.  Without this change, directories show a 4
blocks (they start out at 2048 bytes) and files show 0 blocks; with this
change, they should show a number of blocks proportional to the file size
rounded up to 1024.

Fixes: 31143d5d51 ("AFS: implement basic file write support")
Fixes: 63a4681ff3 ("afs: Locally edit directory data for mkdir/create/unlink/...")
Reported-by: Markus Suvanto <markus.suvanto@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Marc Dionne <marc.dionne@auristor.com>
Tested-by: Markus Suvanto <markus.suvanto@gmail.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/r/163113612442.352844.11162345591911691150.stgit@warthog.procyon.org.uk/
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-30 10:11:01 +02:00
..
addr_list.c
afs_cm.h
afs_fs.h
afs_vl.h
afs.h
cache.c
callback.c
cell.c afs: Fix tracing deref-before-check 2020-10-27 22:05:56 +00:00
cmservice.c afs: Fix tracepoint string placement with built-in AFS 2021-07-28 14:35:41 +02:00
dir_edit.c afs: Fix updating of i_blocks on file/dir extension 2021-09-30 10:11:01 +02:00
dir_silly.c afs: Fix speculative status fetches 2021-05-14 09:50:45 +02:00
dir.c afs: Fix incorrect triggering of sillyrename on 3rd-party invalidation 2021-09-30 10:11:01 +02:00
dynroot.c afs: Add tracing for cell refcount and active user count 2020-10-16 14:39:21 +01:00
file.c afs: Stop listxattr() from listing "afs.*" attributes 2021-03-25 09:04:07 +01:00
flock.c
fs_operation.c afs: Fix speculative status fetches 2021-05-14 09:50:45 +02:00
fs_probe.c
fsclient.c
inode.c afs: Fix updating of i_blocks on file/dir extension 2021-09-30 10:11:01 +02:00
internal.h afs: Fix updating of i_blocks on file/dir extension 2021-09-30 10:11:01 +02:00
Kconfig
main.c afs: Fix an IS_ERR() vs NULL check 2021-06-23 14:42:40 +02:00
Makefile
misc.c
mntpt.c afs: Stop listxattr() from listing "afs.*" attributes 2021-03-25 09:04:07 +01:00
proc.c afs: Add tracing for cell refcount and active user count 2020-10-16 14:39:21 +01:00
protocol_uae.h
protocol_yfs.h
rotate.c
rxrpc.c
security.c
server_list.c
server.c afs: Don't assert on unpurgeable server records 2020-10-16 14:39:34 +01:00
super.c afs: Fix memory leak when mounting with multiple source parameters 2020-12-08 15:59:25 -08:00
vl_alias.c afs: Add tracing for cell refcount and active user count 2020-10-16 14:39:21 +01:00
vl_list.c
vl_probe.c
vl_rotate.c afs: Add tracing for cell refcount and active user count 2020-10-16 14:39:21 +01:00
vlclient.c
volume.c afs: Add tracing for cell refcount and active user count 2020-10-16 14:39:21 +01:00
write.c afs: Fix updating of i_blocks on file/dir extension 2021-09-30 10:11:01 +02:00
xattr.c afs: Stop listxattr() from listing "afs.*" attributes 2021-03-25 09:04:07 +01:00
xdr_fs.h
yfsclient.c afs: Fix warning due to unadvanced marshalling pointer 2020-11-03 09:53:40 -08:00