xfs: lift the XBF_IOEND_FAIL handling into xfs_buf_ioend_disposition
authorChristoph Hellwig <hch@lst.de>
Tue, 1 Sep 2020 17:55:45 +0000 (10:55 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 16 Sep 2020 03:52:38 +0000 (20:52 -0700)
Keep all the error handling code together.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_buf.c

index 0d4eb06..951d9c3 100644 (file)
@@ -1283,6 +1283,14 @@ xfs_buf_ioend_disposition(
        }
 
        /* Still considered a transient error. Caller will schedule retries. */
+       if (bp->b_flags & _XBF_INODES)
+               xfs_buf_inode_io_fail(bp);
+       else if (bp->b_flags & _XBF_DQUOTS)
+               xfs_buf_dquot_io_fail(bp);
+       else
+               ASSERT(list_empty(&bp->b_li_list));
+       xfs_buf_ioerror(bp, 0);
+       xfs_buf_relse(bp);
        return XBF_IOEND_FAIL;
 
 resubmit:
@@ -1336,14 +1344,6 @@ xfs_buf_ioend(
                case XBF_IOEND_DONE:
                        return;
                case XBF_IOEND_FAIL:
-                       if (bp->b_flags & _XBF_INODES)
-                               xfs_buf_inode_io_fail(bp);
-                       else if (bp->b_flags & _XBF_DQUOTS)
-                               xfs_buf_dquot_io_fail(bp);
-                       else
-                               ASSERT(list_empty(&bp->b_li_list));
-                       xfs_buf_ioerror(bp, 0);
-                       xfs_buf_relse(bp);
                        return;
                default:
                        break;