[XFS] Catch unwritten extent conversion errors.
authorDavid Chinner <dgc@sgi.com>
Thu, 10 Apr 2008 02:23:52 +0000 (12:23 +1000)
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>
Fri, 18 Apr 2008 02:00:58 +0000 (12:00 +1000)
On unwritten I/O completion, we fail to propagate an error when converting
the extent to a written extent. This means that the I/O silently fails.
propagate the error onto the ioend so that the inode is marked with an
error appropriately.

SGI-PV: 980084
SGI-Modid: xfs-linux-melb:xfs-kern:30826a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
fs/xfs/linux-2.6/xfs_aops.c

index 169e6c062794626c5066db228e3c055d9f436494..a55c3b26d840e5e7d1be37fcb727dfd3c0f2686a 100644 (file)
@@ -243,8 +243,12 @@ xfs_end_bio_unwritten(
        size_t                  size = ioend->io_size;
 
        if (likely(!ioend->io_error)) {
-               if (!XFS_FORCED_SHUTDOWN(ip->i_mount))
-                       xfs_iomap_write_unwritten(ip, offset, size);
+               if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) {
+                       int error;
+                       error = xfs_iomap_write_unwritten(ip, offset, size);
+                       if (error)
+                               ioend->io_error = error;
+               }
                xfs_setfilesize(ioend);
        }
        xfs_destroy_ioend(ioend);