Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp370675lql; Mon, 11 Mar 2024 05:31:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX9TG+hdGm0SjqhQZe7otUmKob6XzB6DULCQ6VvIUaOkB16+vL83jfqw3ZcZ/vTfIFdt3uJwHP8N2IvtSaAVIU3q9T+YcqrvC7utxUflA== X-Google-Smtp-Source: AGHT+IG0rm8dAc/H+yV57eXGc0F/PZ9XcznFQitWPnx9ZrM9HeMJ5bx+nG1KJNogFSoCS1cmLaBn X-Received: by 2002:a17:90a:ad82:b0:29b:cc7d:60cd with SMTP id s2-20020a17090aad8200b0029bcc7d60cdmr2991817pjq.32.1710160266857; Mon, 11 Mar 2024 05:31:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710160266; cv=pass; d=google.com; s=arc-20160816; b=OoMl3onxkV1Yaze53vwd61eUDxtowq1nonbCV37yq8RLkNHYbVYGO9/cAS3pWCBtJq RO9YtUFl7SoREkkFpQx01jSIN0g6hBGNL0B5CezRgjQzSKe2eD9xor7r5Et3CQ1FVTA2 0Ue9bIrw7yY0JUtcFsUX13Uep78BUAh2dH/7ePu+TNFMpHOpzZJAjrmC5ZbdC33vSvoJ ZKqVtc5/QBmTS2fmrpenwFga3J/2XPWMasXw+xihU22WxsMi7q7b29E61aFDme0Ry+/U JtImcKgfdU23SLexHxVzc22e2/qiZjyHcCo2JE6olxagnc8aMb8PXHVKjTfPRFdfvRAx XLSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=FhZ9bywap0IT5oWnzh3Vet3f15wJ/H3Mj+1WaINAw1M=; fh=5dB93T9RUScPXiJBPgMY9ddAKXpKWIKqxrLOkZR5g5k=; b=g/csGmshtBpe+eYX6DJqNm8XX0fea7TTfgftLGlkio74CECLaGvTK8DKfseuMb4FCk zpZCEhwQ+ZgUHV0T6na5eYB1mD0H0b4cV/lkgmzlJ4+YYCCpcTS4pLQ4cT42H12x3cV+ w218AbO7Wi/5R83enjWkvY2LG4QzY09i+nsa6Ujuo+FWRC6LwDkgA1blfJxfKf28QqDQ bkcdzIzQ2KHC8duVazjDyw2Uqg53BWVveGc6oxcteQx4mg14zo6VYyx+7iJGeBhfX0yc L+I+iE8iNcQ42kTPhNU+rU/2hDLjPR+PPQ7j82mFYld6+NF5omzvKbY8ETDGerHEVUcg Mz3g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-98829-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98829-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id cn3-20020a17090af08300b0029b8534a3cesi8921133pjb.142.2024.03.11.05.31.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 05:31:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98829-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-98829-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98829-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7FB59282753 for ; Mon, 11 Mar 2024 12:31:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 73F08405CB; Mon, 11 Mar 2024 12:30:06 +0000 (UTC) Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 402CF383A9; Mon, 11 Mar 2024 12:30:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710160205; cv=none; b=qLPdBGwJmLLYZFwWOslPv0X6y+bM65/2EgDDOe3vU8tHQ2giFlhcSSvVCDDaCFupRnC85aWRGLnMPIrbFS/lbTksZFxS2erPvZqxn2JsQxDaujYcHE9fp6lkJ/JkWAuijYh/dAh5L+ihSKEWeTDO6QPuRvko/keS4uPcp+/TdjA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710160205; c=relaxed/simple; bh=xMM2DNemWdbPKiUWoRG3Me9R5Y6sBkgMp7tKEGkoQJM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=OYDcN8I1u5EAHKXAxhcaD0aPljhuB9PraBuhwev/hxqFFQXIsaio++8BQndObscOKW+lVdM+cZHxoR7jBTqL+ZXSH3yMTACi5Xzg2EdOSO+DMo8aO9XDSMT1HLTvaakVAUiM8n0BYDWzAO/aRC6tsDJbNj4H7pmOTKkLyDVEaCw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4Ttbgx41qWz4f3lgB; Mon, 11 Mar 2024 20:29:49 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 37E501A017A; Mon, 11 Mar 2024 20:29:57 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP1 (Coremail) with SMTP id cCh0CgDHlxAt+e5lAE9+Gg--.62739S4; Mon, 11 Mar 2024 20:29:55 +0800 (CST) From: Zhang Yi To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, djwong@kernel.org, hch@infradead.org, brauner@kernel.org, david@fromorbit.com, tytso@mit.edu, jack@suse.cz, yi.zhang@huawei.com, yi.zhang@huaweicloud.com, chengzhihao1@huawei.com, yukuai3@huawei.com Subject: [PATCH 0/4] xfs/iomap: fix non-atomic clone operation and don't update size when zeroing range post eof Date: Mon, 11 Mar 2024 20:22:51 +0800 Message-Id: <20240311122255.2637311-1-yi.zhang@huaweicloud.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:cCh0CgDHlxAt+e5lAE9+Gg--.62739S4 X-Coremail-Antispam: 1UD129KBjvJXoWruF4xJrWfAr1DXr48tFyrJFb_yoW8JF1DpF saka1S9r1xGr1xurs3KF45Gw45ta1rZr1UWr1fGw1rZ3y8Ary29r4IgF4FkrWUJr9akw4F qr129Fy8K34UArDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUv014x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j 6r4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628v n2kIc2xKxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F4 0E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFyl IxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxV AFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAFwI0_ Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VU1 a9aPUUUUU== X-CM-SenderInfo: d1lo6xhdqjqx5xdzvxpfor3voofrz/ From: Zhang Yi This patch series fix a problem of exposing zeroed data on xfs since the non-atomic clone operation. This problem was found while I was developing ext4 buffered IO iomap conversion (ext4 is relying on this fix [1]), the root cause of this problem and the discussion about the solution please see [2]. After fix the problem, iomap_zero_range() doesn't need to update i_size so that ext4 can use it to zero partial block, e.g. truncate eof block [3]. [1] https://lore.kernel.org/linux-ext4/20240127015825.1608160-1-yi.zhang@huaweicloud.com/ [2] https://lore.kernel.org/linux-ext4/9b0040ef-3d9d-6246-4bdd-82b9a8f55fa2@huaweicloud.com/ [3] https://lore.kernel.org/linux-ext4/9c9f1831-a772-299b-072b-1c8116c3fb35@huaweicloud.com/ Thanks, Yi. Zhang Yi (4): xfs: match lock mode in xfs_buffered_write_iomap_begin() xfs: convert delayed extents to unwritten when zeroing post eof blocks iomap: don't increase i_size if it's not a write operation iomap: cleanup iomap_write_iter() fs/iomap/buffered-io.c | 78 +++++++++++++++++++++--------------------- fs/xfs/xfs_iomap.c | 39 ++++++++++++++++++--- 2 files changed, 73 insertions(+), 44 deletions(-) -- 2.39.2