mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
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:
parent
ad4497a92c
commit
5b644229bd
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user