Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 339372
b: refs/heads/master
c: 7e18530
h: refs/heads/master
v: v3
  • Loading branch information
Dave Chinner authored and Ben Myers committed Oct 17, 2012
1 parent 97d398b commit 2be0b42
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 39 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 33c7a2bc48a81fa714572f8ce29f29bc17e6faf0
refs/heads/master: 7e18530bef6a18a5479690ae7e8256319ecf1300
6 changes: 4 additions & 2 deletions trunk/fs/xfs/xfs_mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,9 +1450,11 @@ xfs_unmountfs(

/*
* And reclaim all inodes. At this point there should be no dirty
* inode, and none should be pinned or locked, but use synchronous
* reclaim just to be sure.
* inodes and none should be pinned or locked, but use synchronous
* reclaim just to be sure. We can stop background inode reclaim
* here as well if it is still running.
*/
cancel_delayed_work_sync(&mp->m_reclaim_work);
xfs_reclaim_inodes(mp, SYNC_WAIT);

xfs_qm_unmount(mp);
Expand Down
34 changes: 14 additions & 20 deletions trunk/fs/xfs/xfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1005,14 +1005,12 @@ xfs_fs_put_super(
{
struct xfs_mount *mp = XFS_M(sb);

xfs_filestream_unmount(mp);
cancel_delayed_work_sync(&mp->m_sync_work);
xfs_unmountfs(mp);

cancel_delayed_work_sync(&mp->m_sync_work);
cancel_delayed_work_sync(&mp->m_reclaim_work);
cancel_work_sync(&mp->m_flush_work);

xfs_filestream_unmount(mp);
xfs_unmountfs(mp);

xfs_freesb(mp);
xfs_icsb_destroy_counters(mp);
xfs_destroy_mount_workqueues(mp);
Expand Down Expand Up @@ -1325,6 +1323,9 @@ xfs_fs_fill_super(
spin_lock_init(&mp->m_sb_lock);
mutex_init(&mp->m_growlock);
atomic_set(&mp->m_active_trans, 0);
INIT_WORK(&mp->m_flush_work, xfs_flush_worker);
INIT_DELAYED_WORK(&mp->m_sync_work, xfs_sync_worker);
INIT_DELAYED_WORK(&mp->m_reclaim_work, xfs_reclaim_worker);

mp->m_super = sb;
sb->s_fs_info = mp;
Expand Down Expand Up @@ -1388,15 +1389,9 @@ xfs_fs_fill_super(
sb->s_time_gran = 1;
set_posix_acl_flag(sb);

INIT_WORK(&mp->m_flush_work, xfs_flush_worker);
INIT_DELAYED_WORK(&mp->m_sync_work, xfs_sync_worker);
INIT_DELAYED_WORK(&mp->m_reclaim_work, xfs_reclaim_worker);

xfs_syncd_queue_sync(mp);

error = xfs_mountfs(mp);
if (error)
goto out_syncd_stop;
goto out_filestream_unmount;

root = igrab(VFS_I(mp->m_rootip));
if (!root) {
Expand All @@ -1413,12 +1408,15 @@ xfs_fs_fill_super(
goto out_unmount;
}

/*
* The filesystem is successfully mounted, so we can start background
* sync work now.
*/
xfs_syncd_queue_sync(mp);

return 0;
out_syncd_stop:
cancel_delayed_work_sync(&mp->m_sync_work);
cancel_delayed_work_sync(&mp->m_reclaim_work);
cancel_work_sync(&mp->m_flush_work);

out_filestream_unmount:
xfs_filestream_unmount(mp);
out_free_sb:
xfs_freesb(mp);
Expand All @@ -1437,10 +1435,6 @@ xfs_fs_fill_super(
out_unmount:
xfs_filestream_unmount(mp);
xfs_unmountfs(mp);

cancel_delayed_work_sync(&mp->m_sync_work);
cancel_delayed_work_sync(&mp->m_reclaim_work);
cancel_work_sync(&mp->m_flush_work);
goto out_free_sb;
}

Expand Down
21 changes: 5 additions & 16 deletions trunk/fs/xfs/xfs_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,9 @@ xfs_syncd_queue_sync(
}

/*
* Every sync period we need to unpin all items, reclaim inodes and sync
* disk quotas. We might need to cover the log to indicate that the
* filesystem is idle and not frozen.
* Every sync period we need to unpin all items in the AIL and push them to
* disk. If there is nothing dirty, then we might need to cover the log to
* indicate that the filesystem is idle and not frozen.
*/
void
xfs_sync_worker(
Expand All @@ -391,26 +391,15 @@ xfs_sync_worker(
struct xfs_mount, m_sync_work);
int error;

/*
* We shouldn't write/force the log if we are in the mount/unmount
* process or on a read only filesystem. The workqueue still needs to be
* active in both cases, however, because it is used for inode reclaim
* during these times. Use the MS_ACTIVE flag to avoid doing anything
* during mount. Doing work during unmount is avoided by calling
* cancel_delayed_work_sync on this work queue before tearing down
* the ail and the log in xfs_log_unmount.
*/
if (!(mp->m_super->s_flags & MS_ACTIVE) &&
!(mp->m_flags & XFS_MOUNT_RDONLY)) {
if (!(mp->m_flags & XFS_MOUNT_RDONLY)) {
/* dgc: errors ignored here */
if (mp->m_super->s_writers.frozen == SB_UNFROZEN &&
xfs_log_need_covered(mp))
error = xfs_fs_log_dummy(mp);
else
xfs_log_force(mp, 0);

/* start pushing all the metadata that is currently
* dirty */
/* start pushing all the metadata that is currently dirty */
xfs_ail_push_all(mp->m_ail);
}

Expand Down

0 comments on commit 2be0b42

Please sign in to comment.