From mboxrd@z Thu Jan 1 00:00:00 1970 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 D4ABEC77B75 for ; Mon, 15 May 2023 17:49:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244391AbjEORtO (ORCPT ); Mon, 15 May 2023 13:49:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244772AbjEORsp (ORCPT ); Mon, 15 May 2023 13:48:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A557516EBB for ; Mon, 15 May 2023 10:47:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B829A62EEB for ; Mon, 15 May 2023 17:47:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3CBFC433EF; Mon, 15 May 2023 17:47:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1684172824; bh=JBBZAqCpVnZGWOT/N8tULQpXc9e3KSU918TQwfJ6xLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wC9vVMlvmz4lkLsE/2rPpNRQKfwhbxfSEwGtFe/Yz2eia3W5WKb2xrAIlsIYb7eH9 P3IMjlQ9CBRvU6trK17vbYBYxwuQq7HynYGZ/lDPNzQY2Ov0NrdwFxrPBLRosmfkne bpwjJaUSONZ4HOEWWwy9gvnLZWR1JDOqfs5LDj4Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Marc Dionne , David Howells , linux-afs@lists.infradead.org, Sasha Levin Subject: [PATCH 5.10 278/381] afs: Fix updating of i_size with dv jump from server Date: Mon, 15 May 2023 18:28:49 +0200 Message-Id: <20230515161749.334568422@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515161736.775969473@linuxfoundation.org> References: <20230515161736.775969473@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Marc Dionne [ Upstream commit d7f74e9a917503ee78f2b603a456d7227cf38919 ] 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 Signed-off-by: Sasha Levin --- fs/afs/inode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/afs/inode.c b/fs/afs/inode.c index 826fae22a8cc9..fdca4262f806a 100644 --- a/fs/afs/inode.c +++ b/fs/afs/inode.c @@ -218,6 +218,7 @@ static void afs_apply_status(struct afs_operation *op, set_bit(AFS_VNODE_ZAP_DATA, &vnode->flags); } change_size = true; + data_changed = true; } else if (vnode->status.type == AFS_FTYPE_DIR) { /* Expected directory change is handled elsewhere so * that we can locally edit the directory and save on a -- 2.39.2