aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-12-18 15:00:13 -0500
committerBen Myers <bpm@sgi.com>2012-01-17 16:11:07 -0500
commit5bf1f26227a59b9634e95eb3c7c012b766e5e6a0 (patch)
tree940a58e03256bd70787d1341c90027ef334f5fac /fs
parent2813d682e8e6a278f94817429afd46b30875bb6e (diff)
xfs: always return with the iolock held from xfs_file_aio_write_checks
While xfs_iunlock is fine with 0 lockflags the calling conventions are much cleaner if xfs_file_aio_write_checks never returns without the iolock held. Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_file.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 63231392678..134ff2fe4f4 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -636,7 +636,9 @@ out_lock:
636/* 636/*
637 * Common pre-write limit and setup checks. 637 * Common pre-write limit and setup checks.
638 * 638 *
639 * Returns with iolock held according to @iolock. 639 * Called with the iolocked held either shared and exclusive according to
640 * @iolock, and returns with it held. Might upgrade the iolock to exclusive
641 * if called for a direct write beyond i_size.
640 */ 642 */
641STATIC ssize_t 643STATIC ssize_t
642xfs_file_aio_write_checks( 644xfs_file_aio_write_checks(
@@ -653,8 +655,7 @@ xfs_file_aio_write_checks(
653restart: 655restart:
654 error = generic_write_checks(file, pos, count, S_ISBLK(inode->i_mode)); 656 error = generic_write_checks(file, pos, count, S_ISBLK(inode->i_mode));
655 if (error) { 657 if (error) {
656 xfs_rw_iunlock(ip, XFS_ILOCK_EXCL | *iolock); 658 xfs_rw_iunlock(ip, XFS_ILOCK_EXCL);
657 *iolock = 0;
658 return error; 659 return error;
659 } 660 }
660 661