Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp552173lqb; Wed, 17 Apr 2024 04:40:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXpXeZNMNPNRWKKFnGcirYwg0QD4oHpfwgMHy0P6nr3hekH2MPUBkskH+On1u+ay5eEeGRp59nypdzB6vh4y2YghQcRjjOvs0FIOJpKEA== X-Google-Smtp-Source: AGHT+IEUGDTLEjg+pbs5BHNXgeaJnXsFRC+Dh4LpAW9IHdUnIsC6U0L1uepx1cfY6hn4r3pksk/k X-Received: by 2002:a05:620a:e1a:b0:78e:fd19:4e57 with SMTP id y26-20020a05620a0e1a00b0078efd194e57mr2779414qkm.76.1713354052121; Wed, 17 Apr 2024 04:40:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713354052; cv=pass; d=google.com; s=arc-20160816; b=SVtKuNfu4/tGw6CgAjgyKS+XOgl/RwG+Bjax1wMBBEU5519Mms1eZ5trEXsAriQ2hG 2/2Fw1srTYcfdUOESGNSvjaL95Uu+3t3TfGZahqVyMz4ity3JSUCcZiTUBM0tve6XG79 V/YWdRMsWBeWUJXdjkhLoIfwOfT0+etTIj+dPYFlW43cJpaexT2Hl5SLTtEtsmz7NHAj zgPI+aI7lJHsdWTcm+fIynxmhglBwjjO4z7NnFklfiXyevIiQURv+VKtMqk71EUbk0eC GGTDJlwY8HrkIT16morUF0RoNZa8dnd9xqEZbSVY2gnK1PRnAvp0I/GLdRoIQWqh9gDY laMw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Ey6WVgJNfapfFLbsxs6Qp01I9CMO2C3SEc0qltEWJw8=; fh=NVH0xyx056t/nUb+O06prcgpSLgR3/Njz2nW3GM938Q=; b=03F0Xci8WFVcSfDlrepJO/J3vRlv/pfgl5J72O1UOI44Qggi8Zl6wJm+JQPwU5O5nC /+yXnR82Rqj1vPy5D3+6EfjQTbMuZAMSe7LyWlJElZoWP7PGaN0DM/SMewFmjAa7TtY6 0hl2UPOpSKyvf+90ibHh0+HIjUBYvgJ6+rXTs1ZBpZGuIyoI/Sm9jo5VvNiacmeH6SHK bcMkLdI8oKuuzqwjMeIzoJzx4DSr6cUG/kmWY52dogyA93aN2Ptv2fTWTmk8XNVcjg1O Bh5bUqoS46YfXS8ZoD++dWTMwC8kPhdKY5c3csJt3YryytpT6RrMjPl6qod0E5lJx7rC SG8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KsWHGaOu; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-148415-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148415-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e30-20020a05620a209e00b0078a3b070732si14978154qka.36.2024.04.17.04.40.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 04:40:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148415-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KsWHGaOu; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-148415-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148415-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D1F2D1C22E2F for ; Wed, 17 Apr 2024 11:40:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F30ED13CF9A; Wed, 17 Apr 2024 11:40:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KsWHGaOu" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1C9F484E15; Wed, 17 Apr 2024 11:40:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713354043; cv=none; b=gSg6hDBbLtfnhGgDvTxuYz5V55AyfojgRzpwGMtEz/C37ry1jbcSXD0shh4KfOzmzQ8Mdd9EJCE5amWE0ThE6uGzeHfJGgn0qeJE2zubAK4TSSgZVEpK+OQCr4DgsjBrlkR4Eba4pt0zhPsr6kU0KCaE1SHfRQOIl2zK8IdnD0c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713354043; c=relaxed/simple; bh=L43NnvszKlXz0ZmRg0vx9dxOD8La0sz4qHaBZ0rotZs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lB69hbOpWVxIEzK7X37Cw/1Pf8smgnPJeGFYtCuCTnfoNWqN5o2343GFjWRDE8Edg9by/YynePsQlP6f95MXHPvB2SkjRIJ/s9y3qFpneM4LE6+ORZxWlaKNWDxSIAErmTMi/bqcj/2PmejGj8SThorle9gfTwyf6Zs7B+zBlHU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KsWHGaOu; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 106D5C072AA; Wed, 17 Apr 2024 11:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713354042; bh=L43NnvszKlXz0ZmRg0vx9dxOD8La0sz4qHaBZ0rotZs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KsWHGaOuVQdO+3WHAidLoaIDHzCPsv3G9CE/sny7PMLLOv+uQ+BxmvEAT6kpxVINK GpEnsN5vj5V5iooAZ4ouJ+FwA5PbaYrH+CX1pZHLRpsEJZH3zCbUkMzz7Q95FOKGTg IukaDbbshPqvEnKdhyLlMCJh51Wm4s5R5neKQ4ri4JJH8qk1/5YW2BsL5RjlGsggGr hvIWCLTBGFdizQn2golHPkfo69WMCWjgv2NhvNRkFeSEYijORRuPHm6zqlKK4JF2vc Mz1yghTf9nlS6nJf3Lk1UTMzZNJcqDcPOPzK81i0ZKMtgOGCxCopvalPM1HYcHFRQY y28cRshTqMEXw== Date: Wed, 17 Apr 2024 13:40:36 +0200 From: Christian Brauner To: Chandan Babu R Cc: Zhang Yi , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, djwong@kernel.org, hch@infradead.org, david@fromorbit.com, tytso@mit.edu, jack@suse.cz, yi.zhang@huawei.com, chengzhihao1@huawei.com, yukuai3@huawei.com Subject: Re: [PATCH v4 0/9] xfs/iomap: fix non-atomic clone operation and don't update size when zeroing range post eof Message-ID: <20240417-finster-kichern-31077915c0be@brauner> References: <20240320110548.2200662-1-yi.zhang@huaweicloud.com> <87ttk0d2ck.fsf@debian-BULLSEYE-live-builder-AMD64> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87ttk0d2ck.fsf@debian-BULLSEYE-live-builder-AMD64> On Wed, Apr 17, 2024 at 10:12:10AM +0530, Chandan Babu R wrote: > On Wed, Mar 20, 2024 at 07:05:39 PM +0800, Zhang Yi wrote: > > Changes since v3: > > - Improve some git message comments and do some minor code cleanup, no > > logic changes. > > > > Changes since v2: > > - Merge the patch for dropping of xfs_convert_blocks() and the patch > > for modifying xfs_bmapi_convert_delalloc(). > > - Reword the commit message of the second patch. > > > > Changes since v1: > > - Make xfs_bmapi_convert_delalloc() to allocate the target offset and > > drop the writeback helper xfs_convert_blocks(). > > - Don't use xfs_iomap_write_direct() to convert delalloc blocks for > > zeroing posteof case, use xfs_bmapi_convert_delalloc() instead. > > - Fix two off-by-one issues when converting delalloc blocks. > > - Add a separate patch to drop the buffered write failure handle in > > zeroing and unsharing. > > - Add a comments do emphasize updating i_size should under folio lock. > > - Make iomap_write_end() to return a boolean, and do some cleanups in > > buffered write begin path. > > > > 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 (9): > > xfs: match lock mode in xfs_buffered_write_iomap_begin() > > xfs: make the seq argument to xfs_bmapi_convert_delalloc() optional > > xfs: make xfs_bmapi_convert_delalloc() to allocate the target offset > > xfs: convert delayed extents to unwritten when zeroing post eof blocks > > iomap: drop the write failure handles when unsharing and zeroing > > iomap: don't increase i_size if it's not a write operation > > iomap: use a new variable to handle the written bytes in > > iomap_write_iter() > > iomap: make iomap_write_end() return a boolean > > iomap: do some small logical cleanup in buffered write > > > > Hi all, > > I have picked up this patchset for inclusion into XFS' 6.10-rc1 patch > queue. Please let me know if there are any objections. It'd be nice if I could take the iomap patches into the vfs.iomap tree that you can then pull from if you depend on it.. There's already some cleanups in there. Sounds ok?