From patchwork Tue Aug 20 23:20:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13770634 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35232C5320E for ; Tue, 20 Aug 2024 23:21:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9E7416B0085; Tue, 20 Aug 2024 19:21:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 997376B0088; Tue, 20 Aug 2024 19:21:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 837B56B0089; Tue, 20 Aug 2024 19:21:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 645396B0085 for ; Tue, 20 Aug 2024 19:21:25 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id D3BE9406E2 for ; Tue, 20 Aug 2024 23:21:24 +0000 (UTC) X-FDA: 82474197288.24.0E39716 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 55C5B1C0011 for ; Tue, 20 Aug 2024 23:21:22 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ZgAfOfHr; spf=pass (imf18.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724196003; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=fCjK9t7HkWPXdjZnzcV3YJhj3lK29P+RVZIMnJ9iM+Q=; b=qkR3H6qswcC8MGUhxKurASL2IqYERBRBHshnPIGV5tHA7+8zM2mZTP9IZmRnna8hDyEGqW G6nA2R0d726wyGdfRHLNo93ApZtsKAaKiuKXi7Bapjbgg19krV8ODMc38KKZwuI1QvliCJ lLp3VkE3d5CmkUALyVz6QbfxqR6ievA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724196003; a=rsa-sha256; cv=none; b=Xh603urvb9GNWixLTCkb9c1leTIt2KBSOy2XMdAC40YNNHifm9YbSuHKJ8aT4Iummp/jJr n4zwgJimFaWdPIdWBY3VrKSwXJfFnhQHYM2ApFyJIh7OsIXdPG2Kc4VJUvJpBhsQNhRwqR nJu5/hXRDZPXweJ4PMRTihHfZot+tEE= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ZgAfOfHr; spf=pass (imf18.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724196081; 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=fCjK9t7HkWPXdjZnzcV3YJhj3lK29P+RVZIMnJ9iM+Q=; b=ZgAfOfHrMkkFDoPPjzFuEM75a+Egh7BcCkfucIThmMGPsr0t8FWlKX4GhoPHBeT+ifHoXV VlMxv5u6YKnI8Czai42C9JqIpFbOYwEM4HLBp/8wQ6ynwxHSSfp6sifHMpelMWuUAUlVAl QaVhjcFqVy5A1lpPa61rXG35a6yX/KY= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-617-IHAldsebOD2s3EiBWC1CDA-1; Tue, 20 Aug 2024 19:21:16 -0400 X-MC-Unique: IHAldsebOD2s3EiBWC1CDA-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 259D41955F40; Tue, 20 Aug 2024 23:21:13 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.42.28.30]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C53DE19560AA; Tue, 20 Aug 2024 23:21:07 +0000 (UTC) From: David Howells To: Christian Brauner Cc: David Howells , Pankaj Raghav , Jeff Layton , Matthew Wilcox , netfs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/4] mm, netfs, afs: Truncation fixes Date: Wed, 21 Aug 2024 00:20:54 +0100 Message-ID: <20240820232105.3792638-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 55C5B1C0011 X-Stat-Signature: 8e5gtji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nfy5S+dAKOVR6lxtwv79jwTyyDmjS96JJVtI4j99wMR9dZpRX8ZZpXUOQDHAohmesUu9/ljjZwRcM8YpBKH/wfYC3Gfw36RqGXjC/M6syxV3tBYEjY4rIGjffU3BCTVlfV/SjM3nzoyGLwHPtagoBH/Z7iZESKVm+UJklpO8sDq33GDyKRdEWkYKeLmwUUeF2Sv5OIqc/NMTmQTGAJzamJ5azqc8X3Jg2hBBEj9NJ8mxIrikpCYPo3u/KU7SP/+XIHShkMCqVPelYI0ohKOnaU+r6yJW0euuVm5LEbfG3eQ/OX/w== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi Christian, Here are some fixes for truncation, netfslib and afs that I discovered whilst trying Pankaj Raghav's minimum folio order patchset: (1) Fix truncate to make it honour AS_RELEASE_ALWAYS in a couple of places that got missed. (2) Fix duplicated editing of a partially invalidated folio in afs's post-setattr edit phase. (3) Fix netfs_release_folio() to indicate that the folio is busy if the folio is dirty (as does iomap). (4) Fix the trimming of a folio that contain streaming-write data when truncation occurs into or past that folio The patches can also be found here: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=netfs-fixes Thanks, David David Howells (4): mm: Fix missing folio invalidation calls during truncation afs: Fix post-setattr file edit to do truncation correctly netfs: Fix netfs_release_folio() to say no if folio dirty netfs: Fix trimming of streaming-write folios in netfs_inval_folio() fs/afs/inode.c | 11 +++++++--- fs/netfs/misc.c | 53 +++++++++++++++++++++++++++++++++++-------------- mm/truncate.c | 4 ++-- 3 files changed, 48 insertions(+), 20 deletions(-)