From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Tue, 2 Aug 2022 12:58:09 -0500 Subject: [Cluster-devel] [PATCH 1/3] gfs2: Prevent double iput for journal on error In-Reply-To: <20220802175811.438067-1-rpeterso@redhat.com> References: <20220802175811.438067-1-rpeterso@redhat.com> Message-ID: <20220802175811.438067-2-rpeterso@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 journal inode pointer to NULL. Signed-off-by: Bob Peterson --- 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.36.1