diff options
-rw-r--r-- | fs/xfs/xfs_trans_ail.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c index 9f427c2597bb..d7eebbf71362 100644 --- a/fs/xfs/xfs_trans_ail.c +++ b/fs/xfs/xfs_trans_ail.c | |||
@@ -354,7 +354,7 @@ xfs_ail_worker( | |||
354 | struct xfs_ail_cursor *cur = &ailp->xa_cursors; | 354 | struct xfs_ail_cursor *cur = &ailp->xa_cursors; |
355 | xfs_log_item_t *lip; | 355 | xfs_log_item_t *lip; |
356 | xfs_lsn_t lsn; | 356 | xfs_lsn_t lsn; |
357 | xfs_lsn_t target = ailp->xa_target; | 357 | xfs_lsn_t target; |
358 | long tout = 10; | 358 | long tout = 10; |
359 | int flush_log = 0; | 359 | int flush_log = 0; |
360 | int stuck = 0; | 360 | int stuck = 0; |
@@ -362,6 +362,7 @@ xfs_ail_worker( | |||
362 | int push_xfsbufd = 0; | 362 | int push_xfsbufd = 0; |
363 | 363 | ||
364 | spin_lock(&ailp->xa_lock); | 364 | spin_lock(&ailp->xa_lock); |
365 | target = ailp->xa_target; | ||
365 | xfs_trans_ail_cursor_init(ailp, cur); | 366 | xfs_trans_ail_cursor_init(ailp, cur); |
366 | lip = xfs_trans_ail_cursor_first(ailp, cur, ailp->xa_last_pushed_lsn); | 367 | lip = xfs_trans_ail_cursor_first(ailp, cur, ailp->xa_last_pushed_lsn); |
367 | if (!lip || XFS_FORCED_SHUTDOWN(mp)) { | 368 | if (!lip || XFS_FORCED_SHUTDOWN(mp)) { |
@@ -491,7 +492,7 @@ out_done: | |||
491 | * work to do. Wait a bit longer before starting that work. | 492 | * work to do. Wait a bit longer before starting that work. |
492 | */ | 493 | */ |
493 | smp_rmb(); | 494 | smp_rmb(); |
494 | if (ailp->xa_target == target) { | 495 | if (XFS_LSN_CMP(ailp->xa_target, target) == 0) { |
495 | clear_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags); | 496 | clear_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags); |
496 | return; | 497 | return; |
497 | } | 498 | } |
@@ -553,7 +554,7 @@ xfs_ail_push( | |||
553 | * the XFS_AIL_PUSHING_BIT. | 554 | * the XFS_AIL_PUSHING_BIT. |
554 | */ | 555 | */ |
555 | smp_wmb(); | 556 | smp_wmb(); |
556 | ailp->xa_target = threshold_lsn; | 557 | xfs_trans_ail_copy_lsn(ailp, &ailp->xa_target, &threshold_lsn); |
557 | if (!test_and_set_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags)) | 558 | if (!test_and_set_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags)) |
558 | queue_delayed_work(xfs_syncd_wq, &ailp->xa_work, 0); | 559 | queue_delayed_work(xfs_syncd_wq, &ailp->xa_work, 0); |
559 | } | 560 | } |