summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_pnfs.c
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2015-04-13 03:40:16 +0200
committerDave Chinner <david@fromorbit.com>2015-04-13 03:40:16 +0200
commit6a63ef064b2444883ce8b68b0779d0c739d27204 (patch)
tree03414baf93943556fc492e041a389b1c9a671b6a /fs/xfs/xfs_pnfs.c
parentMerge branch 'fallocate-insert-range' into for-next (diff)
parentxfs: unlock i_mutex in xfs_break_layouts (diff)
downloadlinux-6a63ef064b2444883ce8b68b0779d0c739d27204.tar.xz
linux-6a63ef064b2444883ce8b68b0779d0c739d27204.zip
Merge branch 'xfs-misc-fixes-for-4.1-3' into for-next
Conflicts: fs/xfs/xfs_iops.c
Diffstat (limited to 'fs/xfs/xfs_pnfs.c')
-rw-r--r--fs/xfs/xfs_pnfs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/xfs/xfs_pnfs.c b/fs/xfs/xfs_pnfs.c
index 365dd57ea760..981a657eca39 100644
--- a/fs/xfs/xfs_pnfs.c
+++ b/fs/xfs/xfs_pnfs.c
@@ -31,7 +31,8 @@
int
xfs_break_layouts(
struct inode *inode,
- uint *iolock)
+ uint *iolock,
+ bool with_imutex)
{
struct xfs_inode *ip = XFS_I(inode);
int error;
@@ -40,8 +41,12 @@ xfs_break_layouts(
while ((error = break_layout(inode, false) == -EWOULDBLOCK)) {
xfs_iunlock(ip, *iolock);
+ if (with_imutex && (*iolock & XFS_IOLOCK_EXCL))
+ mutex_unlock(&inode->i_mutex);
error = break_layout(inode, true);
*iolock = XFS_IOLOCK_EXCL;
+ if (with_imutex)
+ mutex_lock(&inode->i_mutex);
xfs_ilock(ip, *iolock);
}