xfs: guard against igrab failure in xrep_findparent_from_dcache

LOLLM suggests that we need to handle igrab returning NULL here.  I
don't think it's possible for the inode to enter I_FREEING or
I_WILL_FREE while we have an active reference to the corresponding
dentry, but we can code defensively anyway.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
Darrick J. Wong 2026-09-09 22:59:59 -07:00 committed by Carlos Maiolino
parent ad4497a92c
commit 5b644229bd

View File

@ -473,6 +473,9 @@ xrep_findparent_from_dcache(
pip = igrab(d_inode(parent));
dput(parent);
if (!pip)
goto out_dput;
if (S_ISDIR(pip->i_mode)) {
ret = pip->i_ino;
trace_xrep_findparent_from_dcache(sc->ip, ret);