From: Darrick J. Wong Date: Wed, 3 Jan 2018 19:42:09 +0000 (-0600) Subject: xfs: account for null transactions in bunmapi X-Git-Tag: v4.15.0-rc1~79^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=db2cf1d2ffc41b36abeb7603c8342f18067cef30;p=thirdparty%2Fxfsprogs-dev.git xfs: account for null transactions in bunmapi Source kernel commit: 8c57b88637d78a723e0854fc3d06c6d4c31a1e0c In e1a4e37cc7b665 ("xfs: try to avoid blowing out the transaction reservation when bunmaping a shared extent"), we try to constrain the amount of real extents we unmap from the data fork in a given call so that we don't blow out transaction reservations. However, not all bunmapi operations require a transaction -- if we're only removing a delalloc extent, no transaction is needed, so we have to code against that. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index 50c3d112f..44acff376 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -5127,7 +5127,7 @@ __xfs_bunmapi( * blowing out the transaction with a mix of EFIs and reflink * adjustments. */ - if (xfs_is_reflink_inode(ip) && whichfork == XFS_DATA_FORK) + if (tp && xfs_is_reflink_inode(ip) && whichfork == XFS_DATA_FORK) max_len = min(len, xfs_refcount_max_unmap(tp->t_log_res)); else max_len = len;