aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_sync.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_sync.c')
-rw-r--r--fs/xfs/xfs_sync.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/fs/xfs/xfs_sync.c b/fs/xfs/xfs_sync.c
index c9d3409c5ca3..1e9ee064dbb2 100644
--- a/fs/xfs/xfs_sync.c
+++ b/fs/xfs/xfs_sync.c
@@ -386,23 +386,23 @@ xfs_sync_worker(
386 * We shouldn't write/force the log if we are in the mount/unmount 386 * We shouldn't write/force the log if we are in the mount/unmount
387 * process or on a read only filesystem. The workqueue still needs to be 387 * process or on a read only filesystem. The workqueue still needs to be
388 * active in both cases, however, because it is used for inode reclaim 388 * active in both cases, however, because it is used for inode reclaim
389 * during these times. Use the s_umount semaphore to provide exclusion 389 * during these times. Use the MS_ACTIVE flag to avoid doing anything
390 * with unmount. 390 * during mount. Doing work during unmount is avoided by calling
391 * cancel_delayed_work_sync on this work queue before tearing down
392 * the ail and the log in xfs_log_unmount.
391 */ 393 */
392 if (down_read_trylock(&mp->m_super->s_umount)) { 394 if (!(mp->m_super->s_flags & MS_ACTIVE) &&
393 if (!(mp->m_flags & XFS_MOUNT_RDONLY)) { 395 !(mp->m_flags & XFS_MOUNT_RDONLY)) {
394 /* dgc: errors ignored here */ 396 /* dgc: errors ignored here */
395 if (mp->m_super->s_frozen == SB_UNFROZEN && 397 if (mp->m_super->s_frozen == SB_UNFROZEN &&
396 xfs_log_need_covered(mp)) 398 xfs_log_need_covered(mp))
397 error = xfs_fs_log_dummy(mp); 399 error = xfs_fs_log_dummy(mp);
398 else 400 else
399 xfs_log_force(mp, 0); 401 xfs_log_force(mp, 0);
400 402
401 /* start pushing all the metadata that is currently 403 /* start pushing all the metadata that is currently
402 * dirty */ 404 * dirty */
403 xfs_ail_push_all(mp->m_ail); 405 xfs_ail_push_all(mp->m_ail);
404 }
405 up_read(&mp->m_super->s_umount);
406 } 406 }
407 407
408 /* queue us up again */ 408 /* queue us up again */