diff options
author | Dave Chinner <david@fromorbit.com> | 2009-04-06 12:45:44 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@brick.lst.de> | 2009-04-06 12:45:44 -0400 |
commit | 5825294edd3364cbba6514f70d88debec4f6cec7 (patch) | |
tree | 5462388cdb6b36b2f0f1cf75dc6ee60a7c643a23 /fs/xfs/xfs_iomap.c | |
parent | a8d770d987ee20b59fba6c37d7f0f2a351913c4b (diff) |
xfs: make inode flush at ENOSPC synchronous
When we are writing to a single file and hit ENOSPC, we trigger a background
flush of the inode and try again. Because we hold page locks and the iolock,
the flush won't proceed until after we release these locks. This occurs once
we've given up and ENOSPC has been reported. Hence if this one is the only
dirty inode in the system, we'll get an ENOSPC prematurely.
To fix this, remove the async flush from the allocation routines and move
it to the top of the write path where we can do a synchronous flush
and retry the write again. Only retry once as a second ENOSPC indicates
that we really are ENOSPC.
This avoids a page cache deadlock when trying to do this flush synchronously
in the allocation layer that was identified by Mikulas Patocka.
Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_iomap.c')
-rw-r--r-- | fs/xfs/xfs_iomap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 8b97d82d7a88..7b8b17071030 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c | |||
@@ -347,7 +347,7 @@ xfs_flush_space( | |||
347 | case 0: | 347 | case 0: |
348 | if (ip->i_delayed_blks) { | 348 | if (ip->i_delayed_blks) { |
349 | xfs_iunlock(ip, XFS_ILOCK_EXCL); | 349 | xfs_iunlock(ip, XFS_ILOCK_EXCL); |
350 | xfs_flush_inode(ip); | 350 | delay(1); |
351 | xfs_ilock(ip, XFS_ILOCK_EXCL); | 351 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
352 | *fsynced = 1; | 352 | *fsynced = 1; |
353 | } else { | 353 | } else { |