Revert "Merge remote-tracking branch 'linux-2.6.32.y/master' into develop"
[firefly-linux-kernel-4.4.55.git] / fs / xfs / xfs_log_recover.c
index 1099395d7d6c1cc5250adec130da128a1469ab64..b5b0d80559108a085131f92d3ca8b1ba8a593828 100644 (file)
@@ -1980,7 +1980,7 @@ xlog_recover_do_reg_buffer(
                                        "XFS: NULL dquot in %s.", __func__);
                                goto next;
                        }
-                       if (item->ri_buf[i].i_len < sizeof(xfs_dqblk_t)) {
+                       if (item->ri_buf[i].i_len < sizeof(xfs_disk_dquot_t)) {
                                cmn_err(CE_ALERT,
                                        "XFS: dquot too small (%d) in %s.",
                                        item->ri_buf[i].i_len, __func__);
@@ -2635,7 +2635,7 @@ xlog_recover_do_dquot_trans(
                        "XFS: NULL dquot in %s.", __func__);
                return XFS_ERROR(EIO);
        }
-       if (item->ri_buf[1].i_len < sizeof(xfs_dqblk_t)) {
+       if (item->ri_buf[1].i_len < sizeof(xfs_disk_dquot_t)) {
                cmn_err(CE_ALERT,
                        "XFS: dquot too small (%d) in %s.",
                        item->ri_buf[1].i_len, __func__);
@@ -3517,7 +3517,7 @@ xlog_do_recovery_pass(
 {
        xlog_rec_header_t       *rhead;
        xfs_daddr_t             blk_no;
-       xfs_caddr_t             bufaddr, offset;
+       xfs_caddr_t             offset;
        xfs_buf_t               *hbp, *dbp;
        int                     error = 0, h_size;
        int                     bblks, split_bblks;
@@ -3610,7 +3610,7 @@ xlog_do_recovery_pass(
                        /*
                         * Check for header wrapping around physical end-of-log
                         */
-                       offset = NULL;
+                       offset = XFS_BUF_PTR(hbp);
                        split_hblks = 0;
                        wrapped_hblks = 0;
                        if (blk_no + hblks <= log->l_logBBsize) {
@@ -3646,9 +3646,8 @@ xlog_do_recovery_pass(
                                 *   - order is important.
                                 */
                                wrapped_hblks = hblks - split_hblks;
-                               bufaddr = XFS_BUF_PTR(hbp);
                                error = XFS_BUF_SET_PTR(hbp,
-                                               bufaddr + BBTOB(split_hblks),
+                                               offset + BBTOB(split_hblks),
                                                BBTOB(hblks - split_hblks));
                                if (error)
                                        goto bread_err2;
@@ -3658,14 +3657,10 @@ xlog_do_recovery_pass(
                                if (error)
                                        goto bread_err2;
 
-                               error = XFS_BUF_SET_PTR(hbp, bufaddr,
+                               error = XFS_BUF_SET_PTR(hbp, offset,
                                                        BBTOB(hblks));
                                if (error)
                                        goto bread_err2;
-
-                               if (!offset)
-                                       offset = xlog_align(log, 0,
-                                                       wrapped_hblks, hbp);
                        }
                        rhead = (xlog_rec_header_t *)offset;
                        error = xlog_valid_rec_header(log, rhead,
@@ -3685,7 +3680,7 @@ xlog_do_recovery_pass(
                        } else {
                                /* This log record is split across the
                                 * physical end of log */
-                               offset = NULL;
+                               offset = XFS_BUF_PTR(dbp);
                                split_bblks = 0;
                                if (blk_no != log->l_logBBsize) {
                                        /* some data is before the physical
@@ -3714,9 +3709,8 @@ xlog_do_recovery_pass(
                                 *   _first_, then the log start (LR header end)
                                 *   - order is important.
                                 */
-                               bufaddr = XFS_BUF_PTR(dbp);
                                error = XFS_BUF_SET_PTR(dbp,
-                                               bufaddr + BBTOB(split_bblks),
+                                               offset + BBTOB(split_bblks),
                                                BBTOB(bblks - split_bblks));
                                if (error)
                                        goto bread_err2;
@@ -3727,13 +3721,9 @@ xlog_do_recovery_pass(
                                if (error)
                                        goto bread_err2;
 
-                               error = XFS_BUF_SET_PTR(dbp, bufaddr, h_size);
+                               error = XFS_BUF_SET_PTR(dbp, offset, h_size);
                                if (error)
                                        goto bread_err2;
-
-                               if (!offset)
-                                       offset = xlog_align(log, wrapped_hblks,
-                                               bblks - split_bblks, dbp);
                        }
                        xlog_unpack_data(rhead, offset, log);
                        if ((error = xlog_recover_process_data(log, rhash,