From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.30.100 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796032969; b=c3hHkLR6gPlh+5vEcpbkZW8LQuvrWbglSO1ow5sMBUzOw0HTqxxRTxdtL6jW7v8zebKy M7bzXT76UdOEFfZtDKmHHtC1pTZBwn3liG7ekbKdnI6EK0GMymplSxzA022/oWUBMD5eK tWqG9XCLn5qaWUAFgkigTbgArKnAQttlosiEaqoMXXKS0kLnDQbzvBiAXU3fIeLtyArlL g1dNzXJAyWdXY5ay6XddmsQzFd7ge2+HuwHA+r7VlgiAdHSwz4pMQGaaXWGTKY9C65c6m DpudiuJGGnFCLnvLkDrjEUbHcGvAxlH7gBRfnG+oJDJ4OvNI5IoDxVsNzfk9V8FLy2g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796032969; 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=YapKYo625f7/FhL8Ouxz2B5C9Zr0RvakSLenJiIl6xEJNdKFjyQHfjMLk03ssVyndJM0 pW3C34sjF5s/Idd7FIPySgvP84rc+upeLtDrE07wLb6olAQu7n+q+JIIJ+DC4QjGXDb9X ePg7rOo8DqjNLEvE0Ltp/XwF6+4vcXQQLb1GTEWAxCUOT57cWfmJ/OM9HaqZmgDkAq8kp z/o+C1idXVdZsvHO2ETkoc1u0VjtV7+ayCAFEeW744lHnI6Y2dCeYB15lzZjxaapMwbWr Oj8CZE5Lid213Dt21SQ1NHQbgY8mjJ45Q3Rrt+I7YSI6yIcQZMcb/8t+rol68PvEVHQ== 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="cxCr/s8h"; arc=none smtp.remote-ip=115.124.30.100 Received: from out30-100.freemail.mail.aliyun.com (out30-100.freemail.mail.aliyun.com [115.124.30.100]) (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 943FB606A33D for ; Mon, 30 Nov 2026 10:02:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 943FB606A33D 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=cxCr/s8h DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1796032960; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=VZioQ5RJInbvsZWYJqPBZBUG/lt5FL3dsnOrhLy6O7U=; b=cxCr/s8h7CHG5vw4knSloOSY1ZeNkeNdaSUqtuZZprEW6QnuL4PUbfwsLhbs247t+lqmD+t07M7mWDrbNJ16V5O7rmBpWdP5ERcyhPxHdbykWBeZgYnS9QjtmSAhcMOuGkrXOTYKowyIaBWdbmEVXtq/azOtWidFg0Ul8m/HCWQ= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R991e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037026112;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0XFj7HmB_1796032959; Received: from localhost(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0XFj7HmB_1796032959 cluster:ay36) by smtp.aliyun-inc.com; Mon, 30 Nov 2026 18:02:39 +0800 From: Joseph Qi To: Heming Zhao , hch@lst.de Cc: Andrew Morton , Mark Fasheh , Joel Becker , ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org, Joseph Qi Subject: [RFC PATCH v13 05/10] ocfs2: record the fsync transaction when CoW makes clusters writable Date: Mon, 30 Nov 2026 18:01:58 +0800 Message-Id: <20261130100203.383093-6-joseph.qi@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20261130100203.383093-1-joseph.qi@linux.alibaba.com> References: <20261130100203.383093-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