Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7120907rwr; Tue, 2 May 2023 09:43:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7v5rFkPOZ6HgcqkuiF07pi7Ng2ENwEkFEptyHrPMsS6jXMCmvW6H6m2Hr9T5kPDj5D9lKS X-Received: by 2002:a05:6a00:181d:b0:63b:2102:9fc8 with SMTP id y29-20020a056a00181d00b0063b21029fc8mr25899394pfa.21.1683045832411; Tue, 02 May 2023 09:43:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683045832; cv=none; d=google.com; s=arc-20160816; b=S8fwO2+JlolLNvNA2bYxTUSIzqi4OLv5xt7SkC+7c7Gwel3PmL7ZcotPLcg+6+wc1V X/thto+gXaQphuHgOJGinYAcZ7Ye0pLyaQ6nGjInf23RUD+7vTROnFwf55FnzQ25LqdA qGNVZEjAKvQr/cDqrwDXO4lVWjkGF0wM91OtFME5QtV9NLnD18XwvQnKFu8ta20vPXZp X475YfY1fdIOs5H1JbSYLYbAokzgcJqWpDrvidQ5vMLQpgQBRsR1poTULtUsBfW+V2SE bfLK1IOMoEd2/vzWBnjV4fW2sHqF455KJXUyY1TYA+nL/P3Fq8YMNWEZztcnojD5iikX LP2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tdpnpp8De4O6UqKSmXkRgYIUfjEwCgwR0f9RkM3GpmI=; b=CKPogliAcMi+E0iL6vYHiCOtPWAmFO6eYcJRXOaEROF9x+Cwch2uiGJh+qfx/gPQc2 TVG+j+9qL6wN6u0NgP7p30n25XHBMznkp9yBPwVRiDomuvgMaNp2UVAHUvfNGL01v/or pYbqyyqnjQD95D68+Lbv38wKPJdMzGzNWx8tr8ZoVzTKje0GDL7KhBchqfDy0Ecq+NoN MmNPWVZwZy5S7a9Vc9NxcmfLNLKpOngADuqdctUJilaoq4W6t5YiCOPkyPd7YkgJqZ1o v0gy4arqw602Osv/3wY4p2DbU4uqxtu9muf31ztWlNsnMVC0XubiN3TcPUiupSQfARsU 3rcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y+fxyRJ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z1-20020a63d001000000b005023e0f160dsi30992652pgf.489.2023.05.02.09.43.39; Tue, 02 May 2023 09:43:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y+fxyRJ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234178AbjEBQhi (ORCPT + 99 others); Tue, 2 May 2023 12:37:38 -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: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 = 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