From patchwork Thu Jul 18 13:02:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Foster X-Patchwork-Id: 13736475 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 C6C3AC3DA60 for ; Thu, 18 Jul 2024 13:01:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C4086B0085; Thu, 18 Jul 2024 09:01:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 14DB16B0088; Thu, 18 Jul 2024 09:01:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F2F9B6B0089; Thu, 18 Jul 2024 09:01:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id D3E426B0085 for ; Thu, 18 Jul 2024 09:01:39 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 79C1DA5B50 for ; Thu, 18 Jul 2024 13:01:39 +0000 (UTC) X-FDA: 82352885118.06.16D4E78 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf17.hostedemail.com (Postfix) with ESMTP id 0A95340007 for ; Thu, 18 Jul 2024 13:01:36 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=eV1Ykoc5; spf=pass (imf17.hostedemail.com: domain of bfoster@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bfoster@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=1721307677; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=bk8WncT64lzd4LgIcFxlqG71mv9F7AOrhpNIyzQF2CI=; b=YqGzwBMnjkd2at2oG+Lz/686DrokeVu7lHEzQzvD6MWwyswmZzzgfAqik+nOntogKwQtfE IUuDlXeMa6lC5s1J8edY/Lavsvayxf1aSNw6SZQto/mpVg2h6D7Q1AgOr+W6YjR97fhvCn gIYxI0GeB2zAVQOtGcTjPpixljjELA8= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=eV1Ykoc5; spf=pass (imf17.hostedemail.com: domain of bfoster@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bfoster@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721307677; a=rsa-sha256; cv=none; b=30yGRFTxtcs0qhh+IXc4xqoBY91QICUS8o0EzTlL1WXKndLXyZ3hpaGfohj/MWKf1D5shN XZ+Vv/iC/xjv8lebovxOPzuLT92POhqlYU8l0/HO+tB4187PbOZOHls39A9NnBsa/+S/6F nhLCmRg4Hw9h3JALyMQfOHMGuqSf5sM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721307696; 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: in-reply-to:in-reply-to:references:references; bh=bk8WncT64lzd4LgIcFxlqG71mv9F7AOrhpNIyzQF2CI=; b=eV1Ykoc5f7RyMTPO0gTisO1r1KoUWDCKLaYreFq05VRJuA8avsNPSdL7pqN/H8Kn7kXn// SNzjrseLyCL2SgkmYFN296gEohvdE3956ijfHkhgPD30gk6aUNOTp9xrcKz6Mmwriv0BqA Y/jgHIfEWIW51wxpR0Vcrdxzz97UhF8= Received: from mx-prod-mc-02.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-427-7098IFzjMyC3RB2-ZVHpBA-1; Thu, 18 Jul 2024 09:01:32 -0400 X-MC-Unique: 7098IFzjMyC3RB2-ZVHpBA-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9BFC21955D60; Thu, 18 Jul 2024 13:01:31 +0000 (UTC) Received: from bfoster.redhat.com (unknown [10.22.16.39]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C565B19560B2; Thu, 18 Jul 2024 13:01:30 +0000 (UTC) From: Brian Foster To: linux-fsdevel@vger.kernel.org Cc: linux-xfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 4/4] xfs: remove unnecessary flush of eof page from truncate Date: Thu, 18 Jul 2024 09:02:12 -0400 Message-ID: <20240718130212.23905-5-bfoster@redhat.com> In-Reply-To: <20240718130212.23905-1-bfoster@redhat.com> References: <20240718130212.23905-1-bfoster@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 0A95340007 X-Stat-Signature: n8p3z7x4b9bze136z7bjxanzjkr3zmeh X-HE-Tag: 1721307696-310267 X-HE-Meta: U2FsdGV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lOp6Z+vzifBjb9NGh4997rdJDJb77nprUtApgHiKyodoOx1MKeZ1R1qdjYmoNR+GBHvLCWtG/PXsc9QMxd+cO/QJxJ2h3Jw0+IkDqkImDEDCTEu1wIx3nWOB9rkqf7A8XbYKMMncRrWgdFgLIjkLJU6vKsOFiFxSVQJw8pwzkhIzcIqdaTM5mxQwsbcU= 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: The EOF flush was originally added to work around broken iomap_zero_range() handling of dirty cache over unwritten extents. Now that iomap handles this situation correctly, the flush can be removed. Signed-off-by: Brian Foster --- fs/xfs/xfs_iops.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index ff222827e550..eb0b7a88776d 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -862,16 +862,6 @@ xfs_setattr_size( error = xfs_zero_range(ip, oldsize, newsize - oldsize, &did_zeroing); } else { - /* - * iomap won't detect a dirty page over an unwritten block (or a - * cow block over a hole) and subsequently skips zeroing the - * newly post-EOF portion of the page. Flush the new EOF to - * convert the block before the pagecache truncate. - */ - error = filemap_write_and_wait_range(inode->i_mapping, newsize, - newsize); - if (error) - return error; error = xfs_truncate_page(ip, newsize, &did_zeroing); }