]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/xfs/xfs_buf.c
xfs: remove buffers from the delwri list in xfs_buf_stale
[karo-tx-linux.git] / fs / xfs / xfs_buf.c
index e0339a4a0bc8d0bb0e83aa164b8c369c0d7d66d2..3df7d0a2b245f2f5483529ce38d0503c628b74ea 100644 (file)
@@ -151,6 +151,7 @@ xfs_buf_stale(
        struct xfs_buf  *bp)
 {
        bp->b_flags |= XBF_STALE;
+       xfs_buf_delwri_dequeue(bp);
        atomic_set(&(bp)->b_lru_ref, 0);
        if (!list_empty(&bp->b_lru)) {
                struct xfs_buftarg *btp = bp->b_target;
@@ -1059,9 +1060,8 @@ xfs_bioerror(
         * We're calling xfs_buf_ioend, so delete XBF_DONE flag.
         */
        XFS_BUF_UNREAD(bp);
-       xfs_buf_delwri_dequeue(bp);
        XFS_BUF_UNDONE(bp);
-       XFS_BUF_STALE(bp);
+       xfs_buf_stale(bp);
 
        xfs_buf_ioend(bp, 0);
 
@@ -1088,9 +1088,8 @@ xfs_bioerror_relse(
         * change that interface.
         */
        XFS_BUF_UNREAD(bp);
-       xfs_buf_delwri_dequeue(bp);
        XFS_BUF_DONE(bp);
-       XFS_BUF_STALE(bp);
+       xfs_buf_stale(bp);
        bp->b_iodone = NULL;
        if (!(fl & XBF_ASYNC)) {
                /*
@@ -1100,7 +1099,7 @@ xfs_bioerror_relse(
                 * ASYNC buffers.
                 */
                xfs_buf_ioerror(bp, EIO);
-               XFS_BUF_FINISH_IOWAIT(bp);
+               complete(&bp->b_iowait);
        } else {
                xfs_buf_relse(bp);
        }