From nobody Thu Apr 2 23:54:48 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D640358397 for ; Thu, 26 Mar 2026 06:59:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774508348; cv=none; b=XCSJxUIIXLwQaq2CXnNtMejozhsgs0LgnZMa9v80sXo4vGTqXJZ84gv2bgL6g3cXIvXXx2O8Dd3C35RCwP3aGiGmDxzFCWi34TGGYKCg1EsayT71fzAye9B3vSMlZXCOU3oRZ6Q+kGi4CRRu1hcIKIr124zua5xi5Gp4i80O0Ck= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774508348; c=relaxed/simple; bh=53tbKULyOQRaVzS8QDdsC6bUGbeFbSBM0gzXSXlqSuE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CPEauAGIdz5dKocawJ+KcYtacOqbEvztCFHy3mGJjjp1e4XvzrtpFnLLaOBpz9Q65Ars4TOkWHUw8HUaK0o2J4l780BJpODG9pKsNAjEj9AX8LFGS8doDP2wIL8Jg7GImf7u6z5Gax1n3x71aPiZQ5FwkMGZkLrgdj3e6vJ7VVQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=Uthkm4gt; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Uthkm4gt" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-486fca3245cso206475e9.2 for ; Wed, 25 Mar 2026 23:59:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1774508346; x=1775113146; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rDskmvXad++Rd5SeP2EifaqFOR5Jf0vKwAyNdeQTils=; b=Uthkm4gtgzHNwI2khp5ki0Qbaie2rduK8MnBC1Jc5cCtDKEDZv88SC+W4AGhZOuykO JRdcsWWsw84IRWWqYhE/OEqtwqfX+T8zwpn4lID8MLh3y3rRKRwzZX5/69HQklPNhieZ i5Bl6kvjI2UUzmI2C0tcP40pP6L6CcTMCAiUWRdSbsCnWqziu4UTCze8N4hleKbqHYX+ OqweDrbylHkEVHlOFMbDz91TW9a4cVAQAWZ2pw850DGqnXKx5mQewltlvdGgf+I1ZU9i suRozlasUVyEFkx3P3YYTEZ13rONOGis+h6pttCoY5zG1kXMW8l9jcWAyPdsj2QuaI5F Kcbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774508346; x=1775113146; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=rDskmvXad++Rd5SeP2EifaqFOR5Jf0vKwAyNdeQTils=; b=dCk/Glmrnrvoo5GiAMA0KEcDFtQgSD85n49HQx9vo/waEJF/6UkTwhvi3gb6kM/id2 AaWyrmbBH1dBu5rwYnB0NWRz/gGTVXs4oA8O86Tc0irpe+Gw7KfAd6D6d3IgaAWUwCdQ EL15zaceVDH8zE8spgb0gZ2fLmbtTHrObTjKLpwOSZiFyGNVOQhlbWaCC3nL+Yx9JDWr Bv9Qq0sPnWqMCbWWULYIOTAIBpaKgFNOnzVCdgYMPuep8GB27fGe8VZVTavN/y8SKrZ5 dHeb5dHaZO0qeoksWIun+k8IVWkzp50RqfmW9vT9PHMhFsv08LtWDhN6A4yP6+MrXCKT 3XlA== X-Forwarded-Encrypted: i=1; AJvYcCU4oT8Z+lXW6B8f+/DXTxzywqsCiLkdJ0U2Ts0H8uxnoWJm/j59D10fPoODO1lQs0wf3T1gWMVoSxSPopE=@vger.kernel.org X-Gm-Message-State: AOJu0Yx3824YZQS6t0Yqr74L7l63tHqRjZUXTIolL6vAuM99Fid4UW2o 8Hz28xmGqSOpZ6HhRVSE+aDnOhdQOmx7ns1LIwmQZ4aZ9KS0hpWQpho9SScOgpfLTX8= X-Gm-Gg: ATEYQzzUFFZ0Wp3oTbEVk+yZ9ZomTrRWrERyeLQGu+HZRVrE6EoGWZowf0UtzJew2vc w1GCRfCLOrPSfEG0FQnanUj2tGgDK5zIxu3UO2WF2DZ6yXMjQDPRYYQkG8QknrlPhWGAd5n6CFA iObjcYOGcetDEXC+EqiuY4Q7frNHPTxsX3oI0V2B4DZqOwGjwXKomzV5KB6htGDTqpuKS34uhHt eBlRShppAr5eZCKkR/8BJUXyYvmA7lKy5m262LyTRHXXM3GoGxDPGq8qKVG6RZ4adQDg4ohqawo h5mEh8LIrYjD8gMRcqFXM+b096yQ3C9/eRDoZkMgSm+FMEYNccHN2bkMXaJZVSYDNPc0AM2UbRI o7DlqAFcIR9V38hqaFDEgj+lEBafS/MZ/Ck7G0MCy6baIq78pY7JqAlfV1a1KT/2bgZjSAtyb8K BNzXe8+L6t13VcsNfpRON7O+qUrl4gC5Tu2bcx X-Received: by 2002:a05:600c:3113:b0:486:fb8a:fed with SMTP id 5b1f17b1804b1-487160b3d0bmr50797675e9.8.1774508345665; Wed, 25 Mar 2026 23:59:05 -0700 (PDT) Received: from localhost.localdomain ([202.127.77.110]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b0bc8c4bd3sm20279875ad.63.2026.03.25.23.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Mar 2026 23:59:04 -0700 (PDT) From: Heming Zhao To: joseph.qi@linux.alibaba.com Cc: Heming Zhao , ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org, jack@suse.cz, glass.su@suse.com Subject: [PATCH v3 2/2] Revert "ocfs2: fix DIO failure due to insufficient transaction credits" Date: Thu, 26 Mar 2026 14:58:18 +0800 Message-ID: <20260326065821.15156-3-heming.zhao@suse.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260326065821.15156-1-heming.zhao@suse.com> References: <20260326065821.15156-1-heming.zhao@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit be346c1a6eeb49d8fda827d2a9522124c2f72f36. With the patch "ocfs2: split transactions in dio completion to avoid credit exhaustion," the jbd2 transaction is now restarted every OCFS2_DIO_MARK_EXTENT_BATCH loops. In theory, this should prevent credit exhaustion issues from occurring. Signed-off-by: Heming Zhao --- fs/ocfs2/aops.c | 5 ----- fs/ocfs2/journal.c | 17 ----------------- fs/ocfs2/journal.h | 2 -- fs/ocfs2/ocfs2_trace.h | 2 -- 4 files changed, 26 deletions(-) diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 60f1b607022f..e58314c6506a 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -2332,11 +2332,6 @@ static int ocfs2_dio_end_io_write(struct inode *inod= e, break; } } - ret =3D ocfs2_assure_trans_credits(handle, credits); - if (ret < 0) { - mlog_errno(ret); - break; - } ret =3D ocfs2_mark_extent_written(inode, &et, handle, ue->ue_cpos, 1, ue->ue_phys, diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 4c86a9d46870..7e7546e070fb 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c @@ -464,23 +464,6 @@ int ocfs2_extend_trans(handle_t *handle, int nblocks) return status; } =20 -/* - * Make sure handle has at least 'nblocks' credits available. If it does n= ot - * have that many credits available, we will try to extend the handle to h= ave - * enough credits. If that fails, we will restart transaction to have enou= gh - * credits. Similar notes regarding data consistency and locking implicati= ons - * as for ocfs2_extend_trans() apply here. - */ -int ocfs2_assure_trans_credits(handle_t *handle, int nblocks) -{ - int old_nblks =3D jbd2_handle_buffer_credits(handle); - - trace_ocfs2_assure_trans_credits(old_nblks); - if (old_nblks >=3D nblocks) - return 0; - return ocfs2_extend_trans(handle, nblocks - old_nblks); -} - /* * If we have fewer than thresh credits, extend by OCFS2_MAX_TRANS_DATA. * If that fails, restart the transaction & regain write access for the diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 6397170f302f..9d4763f758ad 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -244,8 +244,6 @@ handle_t *ocfs2_start_trans(struct ocfs2_super *os= b, int ocfs2_commit_trans(struct ocfs2_super *osb, handle_t *handle); int ocfs2_extend_trans(handle_t *handle, int nblocks); -int ocfs2_assure_trans_credits(handle_t *handle, - int nblocks); int ocfs2_allocate_extend_trans(handle_t *handle, int thresh); =20 diff --git a/fs/ocfs2/ocfs2_trace.h b/fs/ocfs2/ocfs2_trace.h index 4b32fb5658ad..74b283875e17 100644 --- a/fs/ocfs2/ocfs2_trace.h +++ b/fs/ocfs2/ocfs2_trace.h @@ -2575,8 +2575,6 @@ DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_commit_cache_end); =20 DEFINE_OCFS2_INT_INT_EVENT(ocfs2_extend_trans); =20 -DEFINE_OCFS2_INT_EVENT(ocfs2_assure_trans_credits); - DEFINE_OCFS2_INT_EVENT(ocfs2_extend_trans_restart); =20 DEFINE_OCFS2_INT_INT_EVENT(ocfs2_allocate_extend_trans); --=20 2.43.0