Patch "netfs, afs: Fix symlink reading" has been added to the 6.18-stable tree

gregkh at linuxfoundation.org gregkh at linuxfoundation.org
Tue Oct 13 03:36:43 PDT 2026


This is a note to let you know that I've just added the patch titled

    netfs, afs: Fix symlink reading

to the 6.18-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     netfs-afs-fix-symlink-reading.patch
and it can be found in the queue-6.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable at vger.kernel.org> know about it.


>From c51e89c5b5db3e1927738fad7cd18b66dde68aed Mon Sep 17 00:00:00 2001
From: David Howells <dhowells at redhat.com>
Date: Tue, 15 Sep 2026 17:21:59 +0100
Subject: netfs, afs: Fix symlink reading

From: David Howells <dhowells at redhat.com>

commit c51e89c5b5db3e1927738fad7cd18b66dde68aed upstream.

Fix the reading of symlinks from the cache in afs by making netfslib trim
the amount read down to i_size.  The problem is that afs sets the size of
the iterator to the size of the buffer (PAGE_SIZE) so that the cache can
round the read size up to the cache's DIO size.

Note that this also impacts the reading of AFS mountpoints as they're just
stored as symlinks with an odd file mode.

Link: https://patch.msgid.link/3912795.1789489319@warthog.procyon.org.uk
Fixes: c0410adf3da6 ("afs: Fix the locking used by afs_get_link()")
Reviewed-by: Paulo Alcantara <pc at manguebit.org>
cc: Paulo Alcantara <pc at manguebit.org>
cc: Marc Dionne <marc.dionne at auristor.com>
cc: linux-afs at lists.infradead.org
cc: netfs at lists.linux.dev
cc: linux-fsdevel at vger.kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner at kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
 fs/netfs/read_collect.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/fs/netfs/read_collect.c
+++ b/fs/netfs/read_collect.c
@@ -409,6 +409,11 @@ static void netfs_rreq_assess_single(str
 		netfs_single_mark_inode_dirty(rreq->inode);
 	}
 
+	/* To do DIO, the cache has to round the size up, so we need to undo
+	 * the rounding.
+	 */
+	rreq->transferred = min(rreq->transferred, rreq->i_size);
+
 	if (rreq->iocb) {
 		rreq->iocb->ki_pos += rreq->transferred;
 		if (rreq->iocb->ki_complete) {


Patches currently in stable-queue which might be from dhowells at redhat.com are

queue-6.18/netfs-fix-folio_queue-enomem-in-writeback-by-adding-.patch
queue-6.18/cifs-call-pagecache_isize_extended-in-cifs_setsize-w.patch
queue-6.18/afs-fix-the-locking-used-by-afs_get_link.patch
queue-6.18/netfs-zero-the-tail-of-a-short-dio-unbuffered-read.patch
queue-6.18/netfs-afs-fix-symlink-reading.patch
queue-6.18/netfs-fix-zeropoint-update-where-i_size-remote_i_siz.patch
queue-6.18/netfs-fix-missing-barriers-when-accessing-stream-sub.patch



More information about the linux-afs mailing list