···19801980 "XFS: NULL dquot in %s.", __func__);19811981 goto next;19821982 }19831983- if (item->ri_buf[i].i_len < sizeof(xfs_dqblk_t)) {19831983+ if (item->ri_buf[i].i_len < sizeof(xfs_disk_dquot_t)) {19841984 cmn_err(CE_ALERT,19851985 "XFS: dquot too small (%d) in %s.",19861986 item->ri_buf[i].i_len, __func__);···26352635 "XFS: NULL dquot in %s.", __func__);26362636 return XFS_ERROR(EIO);26372637 }26382638- if (item->ri_buf[1].i_len < sizeof(xfs_dqblk_t)) {26382638+ if (item->ri_buf[1].i_len < sizeof(xfs_disk_dquot_t)) {26392639 cmn_err(CE_ALERT,26402640 "XFS: dquot too small (%d) in %s.",26412641 item->ri_buf[1].i_len, __func__);
+20-3
fs/xfs/xfs_trans_ail.c
···467467{468468 xfs_log_item_t *dlip = NULL;469469 xfs_log_item_t *mlip; /* ptr to minimum lip */470470+ xfs_lsn_t tail_lsn;470471471472 mlip = xfs_ail_min(ailp);472473···484483485484 if (mlip == dlip) {486485 mlip = xfs_ail_min(ailp);486486+ /*487487+ * It is not safe to access mlip after the AIL lock is488488+ * dropped, so we must get a copy of li_lsn before we do489489+ * so. This is especially important on 32-bit platforms490490+ * where accessing and updating 64-bit values like li_lsn491491+ * is not atomic.492492+ */493493+ tail_lsn = mlip->li_lsn;487494 spin_unlock(&ailp->xa_lock);488488- xfs_log_move_tail(ailp->xa_mount, mlip->li_lsn);495495+ xfs_log_move_tail(ailp->xa_mount, tail_lsn);489496 } else {490497 spin_unlock(&ailp->xa_lock);491498 }···523514{524515 xfs_log_item_t *dlip;525516 xfs_log_item_t *mlip;517517+ xfs_lsn_t tail_lsn;526518527519 if (lip->li_flags & XFS_LI_IN_AIL) {528520 mlip = xfs_ail_min(ailp);···537527538528 if (mlip == dlip) {539529 mlip = xfs_ail_min(ailp);530530+ /*531531+ * It is not safe to access mlip after the AIL lock532532+ * is dropped, so we must get a copy of li_lsn533533+ * before we do so. This is especially important534534+ * on 32-bit platforms where accessing and updating535535+ * 64-bit values like li_lsn is not atomic.536536+ */537537+ tail_lsn = mlip ? mlip->li_lsn : 0;540538 spin_unlock(&ailp->xa_lock);541541- xfs_log_move_tail(ailp->xa_mount,542542- (mlip ? mlip->li_lsn : 0));539539+ xfs_log_move_tail(ailp->xa_mount, tail_lsn);543540 } else {544541 spin_unlock(&ailp->xa_lock);545542 }