Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794936067; b=mwarEXPzuAH+H2HmlkHFeGfZ8IeUAAbUbVabABToPK//gkmVAyvmQwLyVMd8BFD4waCx EfAyJ7LcZ/5ueuI29GkzA3xjbAGH3Fgk+0PKKz7YgrUzxu//o4AuH5T49bKHIZTsJdU4O Ug2/aCtnreQQK+SoFF7OKQcDuV2lRpLJknZ0eQmrLTXYQXPs76Ss9q4csKuo6KYyHwhle bU8QPVtv7Ue6L2aIcHkZVuKJs3Kz7DO7FeAHHVpneLhfcDYuOVluYpHTT7gyXhEUg5Gt1 rYAElPfZ2KPDwoxR/PghEHLW1i7mbyHCl4ybhluyYrvyvU1WNiSL/8GXNLz+drtewrw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794936067; h=DMARC-Filter:DKIM-Signature:X-MC-Rep:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:From:To:Cc:Subject:Date: Message-ID:In-Reply-To:References:MIME-Version:X-Scanned-By: X-Mimecast-MFC-PROC-ID:X-Mimecast-Originator: Content-Transfer-Encoding:content-type; bh=CZaqB8zLqbirkp9myGrNJcVtQI5qFYQmk8ue8ilaeuU=; b=tn1D1685ay/OZOZftvVOfClwPOwYVGwTUPeLD+CcPbS3OVxmX3qptxc6/Q7nTJh9thTA Rk5UtgB4ULLYqLlkH0R0tJo8Bv4jXLAlbrL7Tc9ddwi9Epx2cNvyKZ3jsrJ8VJDp1jrM5 TZWBo/PglgbdUjtNMkAitYZ5/eKUbPoyGosIPQcRSjVtXdU5WbN+8QQ2yAF8pFsmLdh0S my4e1IpRKElspjGC/DtAu6c08tMdEceyUbswQfNCMDFpZJYsKmvjFvrycv3jwfOCU2AIh YQdUFMe8XE33mUcin7OeEFg8AhCIC75FGhN/i5ldV4TaxA/hjV6/1pGM1sTA5sjluDQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=QHPNsJyt; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0ACA606A891 for ; Tue, 17 Nov 2026 17:21:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E0ACA606A891 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=QHPNsJyt DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794936067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CZaqB8zLqbirkp9myGrNJcVtQI5qFYQmk8ue8ilaeuU=; b=QHPNsJyt4EPfAB94BYLEoMkLMVFBp7xpiO2vVq5yQxSf2uzywMVnVc/3tJ32gSxo5uALmA JYg/YdHeaiXaOi3911Sent1kWePLe2kJyfFjoiuiypXgz8aLXjjZ+now0GFaojMQRdAC7L 2k16nGkq+hiucJiaETLzAw3Du4BIi2M= X-MC-Rep: binary re single Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-107-2WD__u3GNjSrhmUjMV98Sw-1; Tue, 17 Nov 2026 12:21:02 -0500 X-MC-Unique: 2WD__u3GNjSrhmUjMV98Sw-1 X-Mimecast-MFC-AGG-ID: 2WD__u3GNjSrhmUjMV98Sw_1794936060 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0AFD718002D1; Tue, 17 Nov 2026 17:21:00 +0000 (UTC) Received: from dhowells-thinkpadp1gen8.rmtgb.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 54B9318004F7; Tue, 17 Nov 2026 17:20:56 +0000 (UTC) From: David Howells To: Christian Brauner Cc: David Howells , Paulo Alcantara , Matthew Wilcox , Namjae Jeon , Marc Dionne , Stefan Metzmacher , Eric Van Hensbergen , Dominique Martinet , Ilya Dryomov , netfs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig Subject: [PATCH v18 07/17] afs: Fix an inconsistency in the symlink code Date: Tue, 17 Nov 2026 17:19:05 +0000 Message-ID: <20261117171958.2982801-8-dhowells@redhat.com> In-Reply-To: <20261117171958.2982801-1-dhowells@redhat.com> References: <20261117171958.2982801-1-dhowells@redhat.com> X-Mailing-List: netfs@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: ov4XiGeW4Y4GJw9BN8R2eufP53lfKEcKLPrvPgC_dAk_1794936060 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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);