Linux XFS filesystem development
 help / color / mirror / Atom feed
From: Anuj Gupta <anuj20.g@samsung.com>
To: djwong@kernel.org, hch@lst.de, cem@kernel.org
Cc: linux-xfs@vger.kernel.org, Anuj Gupta <anuj20.g@samsung.com>
Subject: [PATCH] xfs: release alleged child inode on metapath unlink error
Date: Mon, 31 Aug 2026 12:11:57 +0530	[thread overview]
Message-ID: <20260831064157.758165-1-anuj20.g@samsung.com> (raw)
In-Reply-To: CGME20260831064229epcas5p3825244c86e28b11019cdd2ce90c16eff@epcas5p3.samsung.com

If xchk_metapath_ilock_parent_and_child() fails after xchk_iget()
succeeds, release the inode reference before returning.

Fixes: 0d2c636e489c ("xfs: repair metadata directory file path connectivity")
Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
---
 fs/xfs/scrub/metapath.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/xfs/scrub/metapath.c b/fs/xfs/scrub/metapath.c
index ff1ff762b300..79fd69d2de68 100644
--- a/fs/xfs/scrub/metapath.c
+++ b/fs/xfs/scrub/metapath.c
@@ -550,6 +550,8 @@ xrep_metapath_try_unlink(
 	}
 	if (error) {
 		xchk_trans_cancel(sc);
+		if (ip)
+			xchk_irele(sc, ip);
 		return error;
 	}
 
-- 
2.25.1


       reply	other threads:[~2026-08-31  6:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260831064229epcas5p3825244c86e28b11019cdd2ce90c16eff@epcas5p3.samsung.com>
2026-08-31  6:41 ` Anuj Gupta [this message]
2026-08-31  8:53   ` [PATCH] xfs: release alleged child inode on metapath unlink error Carlos Maiolino
2026-08-31 14:16   ` Darrick J. Wong
2026-09-01  5:44     ` Anuj Gupta/Anuj Gupta

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=20260831064157.758165-1-anuj20.g@samsung.com \
    --to=anuj20.g@samsung.com \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    /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