Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs

* 'for-linus' of git://oss.sgi.com/xfs/xfs:
xfs: copy li_lsn before dropping AIL lock
XFS bug in log recover with quota (bugzilla id 855)

+22 -5
+2 -2
fs/xfs/xfs_log_recover.c
··· 1980 1980 "XFS: NULL dquot in %s.", __func__); 1981 1981 goto next; 1982 1982 } 1983 - if (item->ri_buf[i].i_len < sizeof(xfs_dqblk_t)) { 1983 + if (item->ri_buf[i].i_len < sizeof(xfs_disk_dquot_t)) { 1984 1984 cmn_err(CE_ALERT, 1985 1985 "XFS: dquot too small (%d) in %s.", 1986 1986 item->ri_buf[i].i_len, __func__); ··· 2635 2635 "XFS: NULL dquot in %s.", __func__); 2636 2636 return XFS_ERROR(EIO); 2637 2637 } 2638 - if (item->ri_buf[1].i_len < sizeof(xfs_dqblk_t)) { 2638 + if (item->ri_buf[1].i_len < sizeof(xfs_disk_dquot_t)) { 2639 2639 cmn_err(CE_ALERT, 2640 2640 "XFS: dquot too small (%d) in %s.", 2641 2641 item->ri_buf[1].i_len, __func__);
+20 -3
fs/xfs/xfs_trans_ail.c
··· 467 467 { 468 468 xfs_log_item_t *dlip = NULL; 469 469 xfs_log_item_t *mlip; /* ptr to minimum lip */ 470 + xfs_lsn_t tail_lsn; 470 471 471 472 mlip = xfs_ail_min(ailp); 472 473 ··· 484 483 485 484 if (mlip == dlip) { 486 485 mlip = xfs_ail_min(ailp); 486 + /* 487 + * It is not safe to access mlip after the AIL lock is 488 + * dropped, so we must get a copy of li_lsn before we do 489 + * so. This is especially important on 32-bit platforms 490 + * where accessing and updating 64-bit values like li_lsn 491 + * is not atomic. 492 + */ 493 + tail_lsn = mlip->li_lsn; 487 494 spin_unlock(&ailp->xa_lock); 488 - xfs_log_move_tail(ailp->xa_mount, mlip->li_lsn); 495 + xfs_log_move_tail(ailp->xa_mount, tail_lsn); 489 496 } else { 490 497 spin_unlock(&ailp->xa_lock); 491 498 } ··· 523 514 { 524 515 xfs_log_item_t *dlip; 525 516 xfs_log_item_t *mlip; 517 + xfs_lsn_t tail_lsn; 526 518 527 519 if (lip->li_flags & XFS_LI_IN_AIL) { 528 520 mlip = xfs_ail_min(ailp); ··· 537 527 538 528 if (mlip == dlip) { 539 529 mlip = xfs_ail_min(ailp); 530 + /* 531 + * It is not safe to access mlip after the AIL lock 532 + * is dropped, so we must get a copy of li_lsn 533 + * before we do so. This is especially important 534 + * on 32-bit platforms where accessing and updating 535 + * 64-bit values like li_lsn is not atomic. 536 + */ 537 + tail_lsn = mlip ? mlip->li_lsn : 0; 540 538 spin_unlock(&ailp->xa_lock); 541 - xfs_log_move_tail(ailp->xa_mount, 542 - (mlip ? mlip->li_lsn : 0)); 539 + xfs_log_move_tail(ailp->xa_mount, tail_lsn); 543 540 } else { 544 541 spin_unlock(&ailp->xa_lock); 545 542 }