Don't iunlock an unlocked inode, which can happen if the parent pointer
scrubber bails out with sc->ip unlocked while trying to grab the parent
directory inode.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
                sc->tp = NULL;
        }
        if (sc->ip) {
-               xfs_iunlock(sc->ip, sc->ilock_flags);
+               if (sc->ilock_flags)
+                       xfs_iunlock(sc->ip, sc->ilock_flags);
                if (sc->ip != ip_in &&
                    !xfs_internal_inum(sc->mp, sc->ip->i_ino))
                        iput(VFS_I(sc->ip));