OCFS2-Devel Archive mirror
 help / color / mirror / Atom feed
From: Srivathsa Dara <srivathsa.d.dara@oracle.com>
To: mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com,
	ailiop@suse.com
Cc: srivathsa.d.dara@oracle.com,
	rajesh.sivaramasubramaniom@oracle.com, junxiao.bi@oracle.com,
	ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org,
	gautham.ananthakrishna@oracle.com
Subject: [PATCH v2] ocfs2: call ocfs2_abort when journal abort
Date: Tue, 21 Nov 2023 12:25:23 +0000	[thread overview]
Message-ID: <20231121122523.1859827-1-srivathsa.d.dara@oracle.com> (raw)

From: Ryan Ding <ryan.ding@oracle.com>

Journal can not recover from abort state, so we should panic. Because we
can not release lock resource in this state, other node will hung when it
require a lock owned by this node. So, panic and remaster is a reasonable
choice.

ocfs2_abort() will do above work.

Co-Developed-by: Srivathsa Dara <srivathsa.d.dara@oracle.com>
Signed-off-by: Ryan Ding <ryan.ding@oracle.com>
Signed-off-by: Srivathsa Dara <srivathsa.d.dara@oracle.com>
---
v1-> v2: Remove redundant code and comments related to local mount.
 fs/ocfs2/journal.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index ce215565d061..52d71e9ded2e 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -14,7 +14,6 @@
 #include <linux/kthread.h>
 #include <linux/time.h>
 #include <linux/random.h>
-#include <linux/delay.h>
 #include <linux/writeback.h>
 
 #include <cluster/masklog.h>
@@ -2326,7 +2325,7 @@ static int __ocfs2_wait_on_mount(struct ocfs2_super *osb, int quota)
 
 static int ocfs2_commit_thread(void *arg)
 {
-	int status;
+	int status = 0;
 	struct ocfs2_super *osb = arg;
 	struct ocfs2_journal *journal = osb->journal;
 
@@ -2343,18 +2342,11 @@ static int ocfs2_commit_thread(void *arg)
 
 		status = ocfs2_commit_cache(osb);
 		if (status < 0) {
-			static unsigned long abort_warn_time;
-
-			/* Warn about this once per minute */
-			if (printk_timed_ratelimit(&abort_warn_time, 60*HZ))
-				mlog(ML_ERROR, "status = %d, journal is "
-						"already aborted.\n", status);
 			/*
-			 * After ocfs2_commit_cache() fails, j_num_trans has a
-			 * non-zero value.  Sleep here to avoid a busy-wait
-			 * loop.
+			 * Journal can not recover from abort state, there is
+			 * no need to keep commit cache. So, we should panic.
 			 */
-			msleep_interruptible(1000);
+			ocfs2_abort(osb->sb, "Detected aborted journal");
 		}
 
 		if (kthread_should_stop() && atomic_read(&journal->j_num_trans)){
-- 
2.39.3


                 reply	other threads:[~2023-11-21 12:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231121122523.1859827-1-srivathsa.d.dara@oracle.com \
    --to=srivathsa.d.dara@oracle.com \
    --cc=ailiop@suse.com \
    --cc=gautham.ananthakrishna@oracle.com \
    --cc=jlbec@evilplan.org \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=junxiao.bi@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@fasheh.com \
    --cc=ocfs2-devel@lists.linux.dev \
    --cc=rajesh.sivaramasubramaniom@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).