From: Jeff Mahoney <jeffm@suse.com>
Subject: xfs/dmapi: Add missing unlocks after transaction commit
Patch-mainline: Depends on DMAPI

 This patch adds missing xfs_iunlocks after the transaction has been
 committed in xfs_dm_f_set_eventlist and xfs_dm_set_region.

 Without the patch, xfstests will cause a double-lock deadlock.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 fs/xfs/dmapi/xfs_dm.c |    2 ++
 fs/xfs/xfs_itable.c   |    3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

--- a/fs/xfs/dmapi/xfs_dm.c
+++ b/fs/xfs/dmapi/xfs_dm.c
@@ -713,6 +713,7 @@ xfs_dm_f_set_eventlist(
 	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
 //	igrab(&ip->i_vnode);
 	xfs_trans_commit(tp, 0);
+	xfs_iunlock(ip, XFS_ILOCK_EXCL);
 
 	return(0);
 }
@@ -2613,6 +2614,7 @@ xfs_dm_set_region(
 	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
 //	igrab(inode);
 	xfs_trans_commit(tp, 0);
+	xfs_iunlock(ip, XFS_ILOCK_EXCL);
 
 	/* Return the proper value for *exactflagp depending upon whether or not
 	   we "changed" the user's managed region.  In other words, if the user

