]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/xfs/xfs_log_recover.c
Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[linux.git] / fs / xfs / xfs_log_recover.c
index 99ec3fba45485a1aff9c665be127d102dced6a26..25cfc85dbaa7bd5e6f54d3fdcb050bac579d928d 100644 (file)
@@ -294,7 +294,7 @@ xlog_recover_iodone(
                 * this during recovery. One strike!
                 */
                if (!XFS_FORCED_SHUTDOWN(bp->b_mount)) {
-                       xfs_buf_ioerror_alert(bp, __func__);
+                       xfs_buf_ioerror_alert(bp, __this_address);
                        xfs_force_shutdown(bp->b_mount, SHUTDOWN_META_IO_ERROR);
                }
        }
@@ -1934,6 +1934,12 @@ xlog_recover_buffer_pass1(
        struct list_head        *bucket;
        struct xfs_buf_cancel   *bcp;
 
+       if (!xfs_buf_log_check_iovec(&item->ri_buf[0])) {
+               xfs_err(log->l_mp, "bad buffer log item size (%d)",
+                               item->ri_buf[0].i_len);
+               return -EFSCORRUPTED;
+       }
+
        /*
         * If this isn't a cancel buffer item, then just return.
         */
@@ -2739,15 +2745,10 @@ xlog_recover_buffer_pass2(
        if (buf_f->blf_flags & XFS_BLF_INODE_BUF)
                buf_flags |= XBF_UNMAPPED;
 
-       bp = xfs_buf_read(mp->m_ddev_targp, buf_f->blf_blkno, buf_f->blf_len,
-                         buf_flags, NULL);
-       if (!bp)
-               return -ENOMEM;
-       error = bp->b_error;
-       if (error) {
-               xfs_buf_ioerror_alert(bp, "xlog_recover_do..(read#1)");
-               goto out_release;
-       }
+       error = xfs_buf_read(mp->m_ddev_targp, buf_f->blf_blkno, buf_f->blf_len,
+                         buf_flags, &bp, NULL);
+       if (error)
+               return error;
 
        /*
         * Recover the buffer only if we get an LSN from it and it's less than
@@ -2944,17 +2945,10 @@ xlog_recover_inode_pass2(
        }
        trace_xfs_log_recover_inode_recover(log, in_f);
 
-       bp = xfs_buf_read(mp->m_ddev_targp, in_f->ilf_blkno, in_f->ilf_len, 0,
-                         &xfs_inode_buf_ops);
-       if (!bp) {
-               error = -ENOMEM;
+       error = xfs_buf_read(mp->m_ddev_targp, in_f->ilf_blkno, in_f->ilf_len,
+                       0, &bp, &xfs_inode_buf_ops);
+       if (error)
                goto error;
-       }
-       error = bp->b_error;
-       if (error) {
-               xfs_buf_ioerror_alert(bp, "xlog_recover_do..(read#2)");
-               goto out_release;
-       }
        ASSERT(in_f->ilf_fields & XFS_ILOG_CORE);
        dip = xfs_buf_offset(bp, in_f->ilf_boffset);
 
@@ -5633,7 +5627,7 @@ xlog_do_recover(
        error = xfs_buf_submit(bp);
        if (error) {
                if (!XFS_FORCED_SHUTDOWN(mp)) {
-                       xfs_buf_ioerror_alert(bp, __func__);
+                       xfs_buf_ioerror_alert(bp, __this_address);
                        ASSERT(0);
                }
                xfs_buf_relse(bp);