From nobody Mon Feb 9 03:34:30 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE7B3C77B7E for ; Tue, 2 May 2023 16:37:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234201AbjEBQhj (ORCPT ); Tue, 2 May 2023 12:37:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234231AbjEBQhR (ORCPT ); Tue, 2 May 2023 12:37:17 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08B774497 for ; Tue, 2 May 2023 09:35:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683045343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tdpnpp8De4O6UqKSmXkRgYIUfjEwCgwR0f9RkM3GpmI=; b=Y+fxyRJ5hrPzWdCfgpYgqp3Aci0YEFpK+zrKWK126oyDsU7lMu0dIUU0PhXLP5aXK1ytlS Y7/UNqLfNlDf8P6jfrtZAUJnTfV2GuxqxNl8TH7RFCAKixhgyUrwcmDDHtNuz5p+N3dRS5 S51CJoSQtKBRBB+45XOslbLR2xEs2Bk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-438-YcB8fFMlMq-oG1sBydpvZg-1; Tue, 02 May 2023 12:35:38 -0400 X-MC-Unique: YcB8fFMlMq-oG1sBydpvZg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B510B85C6E7; Tue, 2 May 2023 16:35:37 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB5634020960; Tue, 2 May 2023 16:35:34 +0000 (UTC) From: David Howells To: Linus Torvalds Cc: David Howells , Marc Dionne , linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] afs: Fix updating of i_size with dv jump from server Date: Tue, 2 May 2023 17:35:26 +0100 Message-Id: <20230502163528.1564398-2-dhowells@redhat.com> In-Reply-To: <20230502163528.1564398-1-dhowells@redhat.com> References: <20230502163528.1564398-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Marc Dionne If the data version returned from the server is larger than expected, the local data is invalidated, but we may still want to note the remote file size. Since we're setting change_size, we have to also set data_changed for the i_size to get updated. Fixes: 3f4aa9818163 ("afs: Fix EOF corruption") Signed-off-by: Marc Dionne Signed-off-by: David Howells cc: linux-afs@lists.infradead.org --- fs/afs/inode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/afs/inode.c b/fs/afs/inode.c index b1bdffd5e888..82edd3351734 100644 --- a/fs/afs/inode.c +++ b/fs/afs/inode.c @@ -230,6 +230,7 @@ static void afs_apply_status(struct afs_operation *op, set_bit(AFS_VNODE_ZAP_DATA, &vnode->flags); } change_size =3D true; + data_changed =3D true; } else if (vnode->status.type =3D=3D AFS_FTYPE_DIR) { /* Expected directory change is handled elsewhere so * that we can locally edit the directory and save on a