Fix the afs symlink code to set ->directory_size to the size of the buffer, not PAGE_SIZE-1 or i_size. This doesn't actually change the operation since the value is ignored by the symlink writeback path (which writes to the cache). This was spotted by Claude. Signed-off-by: David Howells cc: Paulo Alcantara cc: Matthew Wilcox cc: Marc Dionne cc: Christoph Hellwig cc: linux-afs@lists.infradead.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org --- fs/afs/symlink.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/afs/symlink.c b/fs/afs/symlink.c index 6b8c122877ca..a1dbd552ddff 100644 --- a/fs/afs/symlink.c +++ b/fs/afs/symlink.c @@ -99,7 +99,7 @@ static ssize_t afs_do_read_symlink(struct afs_vnode *vnode) ret = netfs_alloc_folioq_buffer(NULL, &vnode->directory, &cur_size, PAGE_SIZE, mapping_gfp_mask(vnode->netfs.inode.i_mapping)); - vnode->directory_size = PAGE_SIZE - 1; + vnode->directory_size = PAGE_SIZE; if (ret < 0) return ret; } @@ -116,7 +116,6 @@ static ssize_t afs_do_read_symlink(struct afs_vnode *vnode) trace_afs_file_error(vnode, -EFBIG, afs_file_error_dir_big); return -EFBIG; } - vnode->directory_size = i_size; /* Copy the symlink. */ symlink = kmalloc_flex(struct afs_symlink, content, i_size + 1);