From: Darrick J. Wong Date: Wed, 10 Aug 2016 01:29:36 +0000 (+1000) Subject: xfs: fix locking of the rt bitmap/summary inodes X-Git-Tag: v4.8.0-rc1~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a62ed6d3c5f69611ae909f19c1e1f152e95c320d;p=thirdparty%2Fxfsprogs-dev.git xfs: fix locking of the rt bitmap/summary inodes Source kernel commit: f4a0660de34451e30f0bb8b65946b79c8bd375ca When we're deleting realtime extents, we need to lock the summary inode in case we need to update the summary info to prevent an assert on the rsumip inode lock on a debug kernel. While we're at it, fix the locking annotations so that we avoid triggering lockdep warnings. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index 65de5addd..0bf14fa8a 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -5171,8 +5171,10 @@ xfs_bunmapi( /* * Synchronize by locking the bitmap inode. */ - xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL); + xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL|XFS_ILOCK_RTBITMAP); xfs_trans_ijoin(tp, mp->m_rbmip, XFS_ILOCK_EXCL); + xfs_ilock(mp->m_rsumip, XFS_ILOCK_EXCL|XFS_ILOCK_RTSUM); + xfs_trans_ijoin(tp, mp->m_rsumip, XFS_ILOCK_EXCL); } extno = 0;