From patchwork Tue May 2 18:22:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 89438 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp816795vqo; Tue, 2 May 2023 11:31:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6X7Ll0DzT67bv0EjUUALTtlbOtHJRaksc8yFz5EbFNUsFmUsVCuh9AOAjqF6E4cIkcGWAC X-Received: by 2002:a17:90b:1c0d:b0:23f:3:49c5 with SMTP id oc13-20020a17090b1c0d00b0023f000349c5mr18508950pjb.2.1683052316560; Tue, 02 May 2023 11:31:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683052316; cv=none; d=google.com; s=arc-20160816; b=qi9Y43+OOR4UdtL+/9bwm5JkNQsDQE2cuSiBXePnfeUlHUYzjZ12nzOHhkvA2THHmy BrI8fw8Q1UHqRM9606HosHlVGRbjh9K4g7nrh5jW2G+lNAvmFctzsRTB5+scK7V3xmFc nahyIS3ZH9ve3Qrey2xWRDINb5DdZcyWdYvS3kb1jB8T5nJfLHjjQGPpALUKCSkQrd9/ eQAaqW91PgBs+6FDOtyDNLJyogNOFOCIWgVSrNVf1Us3I1ndtyr4WTFWKI0CCrnJU63o zLRrcurGD1ezW7gOU3UwJCSBN1qK2btfBoIVGQBhWTKZvY486AJ4t2Xz3Ai3WTolaxoP 8leg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-transfer-encoding :content-id:mime-version:subject:cc:to:from:organization :dkim-signature; bh=mUsCC6BRu1wAgmjm+W7fv+mnroL8pCHvi0QoCItydVY=; b=pY8C6n2PuTfgD3KAH32/OmiIcUdbg7Is1bgdWl++wY59ER3q73G1rz8mBn79KZ0Lrc E9iRRn+s1gjIQW+Umu6ayOS3q2fO9d8u2J1FWq+Q4uWOfaTFV+MxYbmM8e4YvhE2YcXV fnb1Tyon1F5qO1y1B4E9skzEqKwbHBykH8K7MkBugkcTxBgftr8663dPhw+fBvS8bLVs v+hikZYy+iC4hFxN701cjWR/EGNvYhlEMDjomrTuDHaJz3uZOtKBN53YvnTkMDikGVT0 kUHmTMtOsQmf3lLflycS5zcxiPnnQf1NDEW+dSt5Ben+I6bJnd7R3jLxOfCjnxhLfPxo HKdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="d1/E3D0P"; 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 hk3-20020a17090b224300b0024b9ac5462csi12613527pjb.94.2023.05.02.11.31.43; Tue, 02 May 2023 11:31:56 -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="d1/E3D0P"; 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 S233902AbjEBSWz (ORCPT + 99 others); Tue, 2 May 2023 14:22:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229586AbjEBSWy (ORCPT ); Tue, 2 May 2023 14:22:54 -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 D688EEC for ; Tue, 2 May 2023 11:22:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683051722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mUsCC6BRu1wAgmjm+W7fv+mnroL8pCHvi0QoCItydVY=; b=d1/E3D0PxONMbkzE7RS3BGo3rDdr0Ew1wu1yLJQtXgCRVL0uoDr7+k/X8NvJtAVQptufPa sHr5nItCZ28524i73gkmmN32x5zzCno6sXbJoFS0cSGOhAXBmKczUZk8qz49PjwnFPe9nF op48rw5q+9srSji7pZ9Nz+KAD+Mr9GA= 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-198-VPhYOgCoNHyawjnCFdSdWQ-1; Tue, 02 May 2023 14:22:01 -0400 X-MC-Unique: VPhYOgCoNHyawjnCFdSdWQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5C79B3825BA7; Tue, 2 May 2023 18:22:01 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA0A61410F24; Tue, 2 May 2023 18:22:00 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 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: [GIT PULL] afs: Fix directory size handling MIME-Version: 1.0 Content-ID: <1647978.1683051720.1@warthog.procyon.org.uk> Date: Tue, 02 May 2023 19:22:00 +0100 Message-ID: <1647979.1683051720@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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=ham 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?1764808265520254968?= X-GMAIL-MSGID: =?utf-8?q?1764808265520254968?= 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. Thanks, David --- The following changes since commit 865fdb08197e657c59e74a35fa32362b12397f58: Merge tag 'input-for-v6.4-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input (2023-05-01 17:18:56 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git tags/afs-fixes-20230502 for you to fetch changes up to 9ea4eff4b6f4f36546d537a74da44fd3f30903ab: afs: Avoid endless loop if file is larger than expected (2023-05-02 17:23:50 +0100) ---------------------------------------------------------------- AFS fixes ---------------------------------------------------------------- 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(-)