]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xfs: fix and streamline error handling in xfs_end_io
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 5 Dec 2017 00:18:30 +0000 (16:18 -0800)
committerJack Vogel <jack.vogel@oracle.com>
Mon, 9 Apr 2018 23:02:00 +0000 (16:02 -0700)
[ Upstream commit 787eb485509f9d58962bd8b4dbc6a5ac6e2034fe ]

There are two different cases of buffered I/O errors:

 - first we can have an already shutdown fs.  In that case we should skip
   any on-disk operations and just clean up the appen transaction if
   present and destroy the ioend
 - a real I/O error.  In that case we should cleanup any lingering COW
   blocks.  This gets skipped in the current code and is fixed by this
   patch.

Orabug: 27609404
Originally-Signed-off-by: Christoph Hellwig <hch@lst.de>
[darrick: heavily modified since we don't support cow in uek4...]
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: wen.gang.wang@oracle.com
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
fs/xfs/xfs_aops.c

index 939abbee0b6c2e8783d4c61b87a6a5b8743c4b79..37e855c1342f94d09661d45a5c438bd8d05a025c 100644 (file)
@@ -237,15 +237,13 @@ xfs_end_io(
                        goto done;
                error = xfs_iomap_write_unwritten(ip, ioend->io_offset,
                                                  ioend->io_size);
-       } else if (ioend->io_append_trans) {
-               error = xfs_setfilesize_ioend(ioend);
-       } else {
-               ASSERT(!xfs_ioend_is_append(ioend));
        }
 
 done:
        if (error)
                ioend->io_error = error;
+       if (ioend->io_append_trans)
+               xfs_setfilesize_ioend(ioend);
        xfs_destroy_ioend(ioend);
 }