Skip to content

Commit

Permalink
Merge tag 'for-linus-v3.9-rc4' of git://oss.sgi.com/xfs/xfs
Browse files Browse the repository at this point in the history
Pull XFS fixes from Ben Myers:

 - Fix for a potential infinite loop which was introduced in commit
   4d559a3 ("xfs: limit speculative prealloc near ENOSPC
   thresholds")

 - Fix for the return type of xfs_iomap_eof_prealloc_initial_size from
   commit a1e16c2 ("xfs: limit speculative prealloc size on sparse
   files")

 - Fix for a failed buffer readahead causing subsequent callers to fail
   incorrectly

* tag 'for-linus-v3.9-rc4' of git://oss.sgi.com/xfs/xfs:
  xfs: ensure we capture IO errors correctly
  xfs: fix xfs_iomap_eof_prealloc_initial_size type
  xfs: fix potential infinite loop in xfs_iomap_prealloc_size()
torvalds committed Mar 19, 2013
2 parents 547b524 + e001873 commit 10b3866
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions fs/xfs/xfs_buf.c
Original file line number Diff line number Diff line change
@@ -1334,6 +1334,12 @@ _xfs_buf_ioapply(
int size;
int i;

/*
* Make sure we capture only current IO errors rather than stale errors
* left over from previous use of the buffer (e.g. failed readahead).
*/
bp->b_error = 0;

if (bp->b_flags & XBF_WRITE) {
if (bp->b_flags & XBF_SYNCIO)
rw = WRITE_SYNC;
4 changes: 2 additions & 2 deletions fs/xfs/xfs_iomap.c
Original file line number Diff line number Diff line change
@@ -325,7 +325,7 @@ xfs_iomap_eof_want_preallocate(
* rather than falling short due to things like stripe unit/width alignment of
* real extents.
*/
STATIC int
STATIC xfs_fsblock_t
xfs_iomap_eof_prealloc_initial_size(
struct xfs_mount *mp,
struct xfs_inode *ip,
@@ -413,7 +413,7 @@ xfs_iomap_prealloc_size(
* have a large file on a small filesystem and the above
* lowspace thresholds are smaller than MAXEXTLEN.
*/
while (alloc_blocks >= freesp)
while (alloc_blocks && alloc_blocks >= freesp)
alloc_blocks >>= 4;
}

0 comments on commit 10b3866

Please sign in to comment.