From: Darrick J. Wong Date: Wed, 17 Jan 2018 02:53:57 +0000 (-0800) Subject: xfs: don't iunlock unlocked inodes X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=638a7174894c8f2195430990b614615ef16e3912;p=openwrt%2Fstaging%2Fblogic.git xfs: don't iunlock unlocked inodes 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 Reviewed-by: Brian Foster --- diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c index 0ed2a123cbb8..26c75967a072 100644 --- a/fs/xfs/scrub/scrub.c +++ b/fs/xfs/scrub/scrub.c @@ -159,7 +159,8 @@ xfs_scrub_teardown( 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));