From patchwork Tue May 2 16:35:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 8843 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp759365vqo; Tue, 2 May 2023 09:54:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6BsDxeotPtz7ed6rRqML0HjrNnmK0mmdxK0XjmJlS3yZ1t1ddXOJR58M9ybXvdlPelhj5y X-Received: by 2002:a17:903:1c9:b0:1a6:f5d5:b7f6 with SMTP id e9-20020a17090301c900b001a6f5d5b7f6mr27633654plh.10.1683046452057; Tue, 02 May 2023 09:54:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683046452; cv=none; d=google.com; s=arc-20160816; b=NhwmnvTONpqo2HdZabDVLvpDLmdxoPBEDILGdOi8fTJp4Yz+D+pOz9NLxBsJba3wih rVdU1suqLP0lDPTlxbnIHydj/0azUsMB4j1r7obHKpCWivOfl+Xb3cc8I1cyS/XKNyqp znku2ZBVQAkRH2qL0yBdLUVfol1YckbcN00ChYi1IQoohowaMBZJRuIA8FMfVIjlCh6B 1eEoVV+5ZlK4ZFR3NbRpEcYXtNTgm8MI0Ecj0mRBilWgVQvydIoUyJWATYflDbyIaM0z EyjME1ESqSuSe1JW8qhuAt5ctNoaciKGCDoRNa4oH2U64siDMnjUVX4nw2BYNzj6/8DO I4rg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=1VegwhAhzGvPahb0A/LosE8qZpmtBgm9WYeZluYuAXE=; b=z5XTUCL8OA3N1W/YxWme+tUxCQcRFyZYmxiaHOxaZDQ5WqyCSIwSMNTJDGdRKRsM1E bMpLF0q3gxRA27SVLox8Ga871OMZlQKFtF6LdC+QCMW2zEeK7t9V2OlEOCmM5nSzqy6n p2Wqvgs6VM1ktr2mDrqMzL/mmSe93r7X3svCduxJTm4UJ7LKg+O5aOiri//2owU8wUGT 9HWFiZQ+di0vXSDoZZkzM7MbMumdnJAPoK64vfVZ+mx1v9AS2Pgvng2/kZpW8LTR8FEc SIUFFb2uYY/eyR7AtRYKGw0B72TovyKdQvg4NlE2VlTj7DI7MvhzhUXPEKZ6RQysHOMP bfLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="ihYb/Mxb"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oj12-20020a17090b4d8c00b0024e2bb99e67si1933011pjb.7.2023.05.02.09.53.58; Tue, 02 May 2023 09:54:12 -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="ihYb/Mxb"; 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 S234084AbjEBQhg (ORCPT + 99 others); Tue, 2 May 2023 12:37:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234223AbjEBQhR (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 84E40448E for ; Tue, 2 May 2023 09:35:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683045337; 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; bh=1VegwhAhzGvPahb0A/LosE8qZpmtBgm9WYeZluYuAXE=; b=ihYb/MxboMuznUSspU9EswfZWofe06rj1adzo6WMfuV+RtGDpdyLnH9x2NQWSMjxvOxxZY rRMYEDWwdAiP2IY0wzlnFC4bAf7N56+SCmDTxrpzDkOPjL+rSKVqNqd80fhrcEmRUIIsl0 vq1ionHKnKZvZ91fBMs+T+zRhNB0oCY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-130-bbzCkDxrOqK36xh9V7qDNw-1; Tue, 02 May 2023 12:35:34 -0400 X-MC-Unique: bbzCkDxrOqK36xh9V7qDNw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E5B933C025A1; Tue, 2 May 2023 16:35:33 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 070A163F4A; Tue, 2 May 2023 16:35:32 +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 0/3] afs: Fix directory size handling Date: Tue, 2 May 2023 17:35:25 +0100 Message-Id: <20230502163528.1564398-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764802116546350194?= X-GMAIL-MSGID: =?utf-8?q?1764802116546350194?= Hi Linus, Could you apply these three fixes to AFS directory handling? (1) Make sure that afs_read_dir() sees any increase in file size if the file unexpectedly changed on the server (e.g. due to another client making a change). (2) Make afs_getattr() always return the server's dir file size, not the locally edited one, so that pagecache eviction doesn't cause the dir file size to change unexpectedly. (3) Prevent afs_read_dir() from getting into an endless loop if the server indicates that the directory file size is larger than expected. The patches can be found here: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=afs-fixes Thanks, David --- %(shortlog)s %(diffstat)s David Howells (1): afs: Fix getattr to report server i_size on dirs, not local size Marc Dionne (2): afs: Fix updating of i_size with dv jump from server afs: Avoid endless loop if file is larger than expected fs/afs/dir.c | 4 ++++ fs/afs/inode.c | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-)