Files
linux/fs/afs
David Howells a74ee0e878 afs: Fix post-setattr file edit to do truncation correctly
At the end of an kAFS RPC operation, there is an "edit" phase (originally
intended for post-directory modification ops to edit the local image) that
the setattr VFS op uses to fix up the pagecache if the RPC that requested
truncation of a file was successful.

afs_setattr_edit_file() calls truncate_setsize() which sets i_size, expands
the pagecache if needed and truncates the pagecache.  The first two of
those, however, are redundant as they've already been done by
afs_setattr_success() under the io_lock and the first is also done under
the callback lock (cb_lock).

Fix afs_setattr_edit_file() to call truncate_pagecache() instead (which is
called by truncate_setsize(), thereby skipping the redundant parts.

Fixes: 100ccd18bb ("netfs: Optimise away reads above the point at which there can be no data")
Signed-off-by: David Howells <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
cc: Matthew Wilcox (Oracle) <[email protected]>
cc: Pankaj Raghav <[email protected]>
cc: Jeff Layton <[email protected]>
cc: Marc Dionne <[email protected]>
cc: [email protected]
cc: [email protected]
cc: [email protected]
cc: [email protected]
Signed-off-by: Christian Brauner <[email protected]>
2024-08-24 16:09:16 +02:00
..
…
…
2024-07-03 19:29:55 -07:00
2023-12-24 15:22:53 +00:00
2024-07-03 19:29:55 -07:00
2024-08-13 13:53:09 +02:00
2024-01-01 16:37:27 +00:00
2024-01-01 16:37:27 +00:00
2024-02-20 09:51:21 +01:00
2023-12-24 15:22:53 +00:00
2024-01-01 16:37:27 +00:00
2024-02-20 09:51:21 +01:00