summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_ioctl.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2013-10-12 00:55:06 -0700
committerBen Myers <bpm@sgi.com>2013-10-21 16:54:22 -0500
commit5f8aca8b43f41c4b2d4dc5389124a40cab92b644 (patch)
tree703fc7c2042cc467022cf1be22efdd72e829c3af /fs/xfs/xfs_ioctl.c
parent001a3e73706fcb8c52dcca1d4742679384d04184 (diff)
downloadop-kernel-dev-5f8aca8b43f41c4b2d4dc5389124a40cab92b644.zip
op-kernel-dev-5f8aca8b43f41c4b2d4dc5389124a40cab92b644.tar.gz
xfs: always hold the iolock when calling xfs_change_file_space
Currently fallocate always holds the iolock when calling into xfs_change_file_space, while the ioctl path lets some of the lower level functions take it, but leave it out in others. This patch makes sure the ioctl path also always holds the iolock and thus introduces consistent locking for the preallocation operations while simplifying the code and allowing to kill the now unused XFS_ATTR_NOLOCK flag. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_ioctl.c')
-rw-r--r--fs/xfs/xfs_ioctl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 5a57e0c..4528741 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -670,7 +670,9 @@ xfs_ioc_space(
error = mnt_want_write_file(filp);
if (error)
return error;
+ xfs_ilock(ip, XFS_IOLOCK_EXCL);
error = xfs_change_file_space(ip, cmd, bf, filp->f_pos, attr_flags);
+ xfs_iunlock(ip, XFS_IOLOCK_EXCL);
mnt_drop_write_file(filp);
return -error;
}
OpenPOWER on IntegriCloud