Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.30.118 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796119665; b=pkieEljHrxE4U35SMAwr0JXgWEEnHcLzjZ9QUL/tn6VUNaWyihBnoewiVoRWe2Mt3ABk WBRc7gXreRtLxgGvu1kTNJSrog1/rBzP5/OBQfNOOU7oL6BN9HhUfm21GkQrjLuXuQQfR LET8RapNTasSFa209XD8jHOTbFz4xBTvNFwMORaakforbIiT3q+yR97SfEM/DAPeoqKxC e5xA25qJKpYzHfIdgU4smj282kkolIFUaBoJAAiiBdA0VtnIOejFUj1tOuGNhEVy06QJM X+wo2eydJ0y1ZCYX9HS8+XmSYxI6gAQ4mM4H0BvPaP03BU1wilEGdq6nO4EBWPkhgPQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796119665; h=DMARC-Filter:DKIM-Signature:X-Alimail-AntiSpam:Received:From:To:Cc: Subject:Date:Message-Id:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=VZioQ5RJInbvsZWYJqPBZBUG/lt5FL3dsnOrhLy6O7U=; b=ZCDraghZm654vERGVPGhcfWOoe7vyAqW+hlpD8DX+RMZdzkvjk4VkoQD6M6v8trzTTvl VcAe/ia7oDYgMObdFJRBwWQinMz1B4fKM44oZdNjSShaWalnN0Uz3SOv4L1L229TAGOPQ mXHZE8TT8oRkWvTUySGMOa867RXdfFf2rs9e2Mnr2oqDWMQyTW3flpcnf8Pr4jx0tZH0k ptiaZBGtTMdR5m3sYxVKdNtLMtUgMe8nFGJ79aUOf84iGT7Ui4skWx/E1zegu6upj56nw FPtPErHM9xuseQycKb6udu+REVA7IJDoRESLSbpura6mtN+nBrTMSyOpYD/Fvpy1TnQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=tyTQxXZk; arc=none smtp.remote-ip=115.124.30.118 Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC933606A32E for ; Tue, 1 Dec 2026 10:07:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CC933606A32E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=tyTQxXZk DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1796119661; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=VZioQ5RJInbvsZWYJqPBZBUG/lt5FL3dsnOrhLy6O7U=; b=tyTQxXZkeO3Uvh63j3ohQCCSDsiYuKDFDicvnC+vsKfgz7+hBh/d923XD0shQJojGxKfWO7SCZfNcN7zjI5XXwNgXbmvL4CRgd1zBmCTqnknat3APTdxtwFMNG2ggY7yKd/dLDTdMQvYrYv0cr8T5ahz0u3dTjItlcUVI8uABHg= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037033178;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0XFzGSoT_1796119660; Received: from localhost(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0XFzGSoT_1796119660 cluster:ay36) by smtp.aliyun-inc.com; Tue, 01 Dec 2026 18:07:41 +0800 From: Joseph Qi To: hch@lst.de, Heming Zhao Cc: Andrew Morton , Mark Fasheh , Joel Becker , ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org, Joseph Qi Subject: [RFC PATCH v14 05/10] ocfs2: record the fsync transaction when CoW makes clusters writable Date: Tue, 1 Dec 2026 18:07:19 +0800 Message-Id: <20261201100724.2909559-6-joseph.qi@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20261201100724.2909559-1-joseph.qi@linux.alibaba.com> References: <20261201100724.2909559-1-joseph.qi@linux.alibaba.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Heming Zhao ocfs2_make_clusters_writable() changes the extent tree to break a refcount sharing, but it does not record the transaction in the inode's datasync tid. A subsequent O_DSYNC or fsync that relies on i_datasync_tid can therefore consider the CoW already committed and skip waiting for it. Record it on the success path, like the other extent tree changes do. Fixes: 6f70fa519976 ("ocfs2: Add CoW support.") Co-developed-by: Joseph Qi Signed-off-by: Joseph Qi Signed-off-by: Heming Zhao --- fs/ocfs2/refcounttree.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 4f13b5a6faa7d..485104aab14e6 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c @@ -3360,6 +3360,8 @@ static int ocfs2_make_clusters_writable(struct super_block *sb, } out_commit: + if (!ret) + ocfs2_update_inode_fsync_trans(handle, context->inode, 1); ocfs2_commit_trans(osb, handle); out: -- 2.39.3