summaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-01-16 18:53:57 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2018-01-17 21:00:46 -0800
commit638a7174894c8f2195430990b614615ef16e3912 (patch)
treea9a8ab5b8e6b9b5e7fdc326d9a10531ed9eb0a0a /fs/xfs
parentcf1b0b8b1a43102cdc0189d76d1c05915c4e16a6 (diff)
downloadop-kernel-dev-638a7174894c8f2195430990b614615ef16e3912.zip
op-kernel-dev-638a7174894c8f2195430990b614615ef16e3912.tar.gz
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 <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/scrub/scrub.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
index 0ed2a12..26c7596 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));
OpenPOWER on IntegriCloud