From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.30.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796301654; b=4i79Hu+OH0wjEZ9/5ryl/a+cykPVFDMV4IgjRO005x2qDQF0k5AY0T6n50NczAtneVRF PGWG4zgNkGclh0W99+Czuiqk6MkMBJzY1djjtu7OYfJ2/8+zA9fspvNxDfjQb82Y/v+Qn 4ALX5ibrOXz0lCsq84yDarwFct0/TxrFn4PXMMHSYo4u51luH84jW++IGbxvWwI7vG+7G 1yiAGzPqv1J9NROWCNvxH1i1twVLmGZyKL2tHhdEtTYv3HWLkH/kLsM4AmaQvJFn7b4NJ t0pI1qrSV8GfirNApa5by0ahzirP0oO2NrUg7ucumPmwqW015uG5TrB928y4Kr4Znjw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796301654; 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=phjPvTXVSb/l7ClZgXgh7XtD01bffbAhZ9O2GghLXmM=; b=pHq8hV9jblWb2OoRAiCj+gDoADMFq9VL4X3l8PVEh3EGp7+KH2B/S1sKyaVxsNZX3VO2 4Frd6i0jJYMdzbDq7GDWX98ah7Jle86Y8hh6nBjBsgw14qxuyuqh7eWBoiF+L/GPIMyJP UYA373keaM72O6JUVzsEGlZlVDOD7N8ITXxG9MAevcAAEfm/K5bcQd81p56wGGY5yoW9V ZezvdxRogmPI4JDYtcJpbuyWiuxk4wnLX1cWVf/4Kw1p7uV9+GypC6HsGOD/2rbCmeL/y se0rJWfLdAJJQB6vlP7Dk1zHbECJCA5bcV6ze1GaYBpbbmUJMh89dU9VbV6WVfS/fIQ== 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=KygVKTUx; arc=none smtp.remote-ip=115.124.30.124 Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) (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 2BF02606A68E for ; Thu, 3 Dec 2026 12:40:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2BF02606A68E 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=KygVKTUx DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1796301644; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=phjPvTXVSb/l7ClZgXgh7XtD01bffbAhZ9O2GghLXmM=; b=KygVKTUxzbMy2ESOfHMoqteERKrxiuspko57GHUquVIV9PMljcg/Q9oRJ/nxGhXpgdEzD5kTuylnIgwT11Mmht8/sHMhPYwJjV6zB16r/WyegutaUkDeY1AWtpCAwrdq2wdJbSs+Dznueh/hK4H8s+vdkdrYhshevaLShHi0OMU= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037009110;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0XGEFrDc_1796301643; Received: from localhost(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0XGEFrDc_1796301643 cluster:ay36) by smtp.aliyun-inc.com; Thu, 03 Dec 2026 20:40:44 +0800 From: Joseph Qi To: Andrew Morton , Heming Zhao , hch@lst.de Cc: Mark Fasheh , Joel Becker , ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org, Joseph Qi Subject: [PATCH v16 05/10] ocfs2: record the fsync transaction when CoW makes clusters writable Date: Thu, 3 Dec 2026 20:40:32 +0800 Message-Id: <20261203124037.4112319-6-joseph.qi@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20261203124037.4112319-1-joseph.qi@linux.alibaba.com> References: <20261203124037.4112319-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 | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 4f13b5a6faa7d..2e2f3becb8da9 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c @@ -3360,6 +3360,7 @@ static int ocfs2_make_clusters_writable(struct super_block *sb, } out_commit: + ocfs2_update_inode_fsync_trans(handle, context->inode, 1); ocfs2_commit_trans(osb, handle); out: -- 2.39.3