diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-05-11 11:04:10 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2011-05-25 11:48:37 -0400 |
commit | ab1908a5bb21a8eebf16e5d92d087fd9413cf67d (patch) | |
tree | 7c8728635209cb8f463c97ba934875fa1388e370 /fs/xfs | |
parent | f1c63b73cf60dc4800cde5ce7fd9466c419e5e36 (diff) |
xfs: fix up asserts in xfs_iflush_fork
Remove asserts in xfs_iflush_fork that would call xfs_iext_get_ext
with a potentially invalid extent buffer index.
Based on an earlier patch from Lachlan McIlroy.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Lachlan McIlroy <lmcilroy@redhat.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_inode.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index c96bdeda23bb..6f318eeac401 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -2557,12 +2557,9 @@ xfs_iflush_fork( | |||
2557 | case XFS_DINODE_FMT_EXTENTS: | 2557 | case XFS_DINODE_FMT_EXTENTS: |
2558 | ASSERT((ifp->if_flags & XFS_IFEXTENTS) || | 2558 | ASSERT((ifp->if_flags & XFS_IFEXTENTS) || |
2559 | !(iip->ili_format.ilf_fields & extflag[whichfork])); | 2559 | !(iip->ili_format.ilf_fields & extflag[whichfork])); |
2560 | ASSERT((xfs_iext_get_ext(ifp, 0) != NULL) || | ||
2561 | (ifp->if_bytes == 0)); | ||
2562 | ASSERT((xfs_iext_get_ext(ifp, 0) == NULL) || | ||
2563 | (ifp->if_bytes > 0)); | ||
2564 | if ((iip->ili_format.ilf_fields & extflag[whichfork]) && | 2560 | if ((iip->ili_format.ilf_fields & extflag[whichfork]) && |
2565 | (ifp->if_bytes > 0)) { | 2561 | (ifp->if_bytes > 0)) { |
2562 | ASSERT(xfs_iext_get_ext(ifp, 0)); | ||
2566 | ASSERT(XFS_IFORK_NEXTENTS(ip, whichfork) > 0); | 2563 | ASSERT(XFS_IFORK_NEXTENTS(ip, whichfork) > 0); |
2567 | (void)xfs_iextents_copy(ip, (xfs_bmbt_rec_t *)cp, | 2564 | (void)xfs_iextents_copy(ip, (xfs_bmbt_rec_t *)cp, |
2568 | whichfork); | 2565 | whichfork); |