From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13FB7171AE for ; Mon, 8 May 2023 11:46:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C334C433EF; Mon, 8 May 2023 11:46:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1683546366; bh=2yX76qLcn1KkNIJrDXgeIgBXiy8XGQgn4DbjAXQFVQs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PvzRFlR5/UgCUIx8lvk5AJ5+MyO1Hd6ivepw7Rooi+/Uk+edPK87eZofqsHtk+8Vf evrY6GLOto/xk6vvZaz+M3ihywlrpoWbp693v7K/+9IclOvJt5P9dZU2D8XNDvRf5F jz3Nb9glvVaFcxy7h0QoTzyOVSZQ/KunFiGS1nxo= 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.15 344/371] afs: Fix updating of i_size with dv jump from server Date: Mon, 8 May 2023 11:49:05 +0200 Message-Id: <20230508094825.799944115@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230508094811.912279944@linuxfoundation.org> References: <20230508094811.912279944@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 785bacb972da5..91b1f8cabd58f 100644 --- a/fs/afs/inode.c +++ b/fs/afs/inode.c @@ -219,6 +219,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