cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 v3 PATCH 1/3] gfs2: Prevent double iput for journal on error
Date: Thu, 18 Aug 2022 13:32:36 -0500	[thread overview]
Message-ID: <20220818183238.121677-2-rpeterso@redhat.com> (raw)
In-Reply-To: <20220818183238.121677-1-rpeterso@redhat.com>

When a gfs2 file system is withdrawn it does iput on its journal to
allow recovery from another cluster node. If it's unable to get a
replacement inode for whatever reason, the journal descriptor would
still be pointing at the evicted inode. So when unmount clears out the
list of journals, it would do a second iput referencing the pointer.
To avoid this, set the inode pointer to NULL.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
 fs/gfs2/util.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c
index 8241029a2a5d..95c79a3ec161 100644
--- a/fs/gfs2/util.c
+++ b/fs/gfs2/util.c
@@ -204,6 +204,7 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
 	 * exception code in glock_dq.
 	 */
 	iput(inode);
+	sdp->sd_jdesc->jd_inode = NULL;
 	/*
 	 * Wait until the journal inode's glock is freed. This allows try locks
 	 * on other nodes to be successful, otherwise we remain the owner of
-- 
2.37.2


  reply	other threads:[~2022-08-18 18:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18 18:32 [Cluster-devel] [GFS2 v3 PATCH 0/3] gfs2: Misc withdraw patches (version 3) Bob Peterson
2022-08-18 18:32 ` Bob Peterson [this message]
2022-08-18 18:32 ` [Cluster-devel] [GFS2 v3 PATCH 2/3] gfs2: Dequeue waiters when withdrawn Bob Peterson
2022-08-18 18:32 ` [Cluster-devel] [GFS2 v3 PATCH 3/3] gfs2: Clear flags when withdraw prevents xmote Bob Peterson
2022-08-25 15:59 ` [Cluster-devel] [GFS2 v3 PATCH 0/3] gfs2: Misc withdraw patches (version 3) Andreas Gruenbacher

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=20220818183238.121677-2-rpeterso@redhat.com \
    --to=rpeterso@redhat.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 NNTP newsgroup(s).