From: Christoph Hellwig Date: Mon, 23 Oct 2017 23:32:38 +0000 (-0700) Subject: xfs: add asserts for the mmap lock in xfs_{insert,collapse}_file_space X-Git-Tag: rel_imx_4.19.35_1.1.0~11318^2~61 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=9ad1a23afb6c561acfa62850934ddc6c70c35994;p=linux.git xfs: add asserts for the mmap lock in xfs_{insert,collapse}_file_space Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index 034f3429ca8c..170b74c7f2d5 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -1334,6 +1334,8 @@ xfs_collapse_file_space( bool done = false; ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); + ASSERT(xfs_isilocked(ip, XFS_MMAPLOCK_EXCL)); + trace_xfs_collapse_file_space(ip); error = xfs_free_file_space(ip, offset, len); @@ -1408,6 +1410,8 @@ xfs_insert_file_space( bool done = false; ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); + ASSERT(xfs_isilocked(ip, XFS_MMAPLOCK_EXCL)); + trace_xfs_insert_file_space(ip); error = xfs_prepare_shift(ip, offset);