aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_super.c
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2012-04-13 08:10:44 -0400
committerBen Myers <bpm@sgi.com>2012-04-17 12:19:47 -0400
commit8a00ebe4cfc90eda9ecb575ba97e22021cd8cf70 (patch)
tree06e97168b62fb7acdf44f6610c1e6ea268822f3d /fs/xfs/xfs_super.c
parentda5bf95e3cdca348327c82568c2860229c0daaa2 (diff)
xfs: Ensure inode reclaim can run during quotacheck
Because the mount process can run a quotacheck and consume lots of inodes, we need to be able to run periodic inode reclaim during the mount process. This will prevent running the system out of memory during quota checks. This essentially reverts 2bcf6e97, but that is safe to do now that the quota sync code that was causing problems during long quotacheck executions is now gone. The reclaim work is currently protected from running during the unmount process by a check against MS_ACTIVE. Unfortunately, this also means that the reclaim work cannot run during mount. The unmount process should stop the reclaim cleanly before freeing anything that the reclaim work depends on, so there is no need to have this guard in place. Also, the inode reclaim work is demand driven, so there is no need to start it immediately during mount. It will be started the moment an inode is queued for reclaim, so qutoacheck will trigger it just fine. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_super.c')
-rw-r--r--fs/xfs/xfs_super.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 93f7a3f750d3..b5aafc395ea1 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -981,8 +981,6 @@ xfs_fs_put_super(
981{ 981{
982 struct xfs_mount *mp = XFS_M(sb); 982 struct xfs_mount *mp = XFS_M(sb);
983 983
984 xfs_syncd_stop(mp);
985
986 /* 984 /*
987 * Blow away any referenced inode in the filestreams cache. 985 * Blow away any referenced inode in the filestreams cache.
988 * This can and will cause log traffic as inodes go inactive 986 * This can and will cause log traffic as inodes go inactive
@@ -993,6 +991,7 @@ xfs_fs_put_super(
993 xfs_flush_buftarg(mp->m_ddev_targp, 1); 991 xfs_flush_buftarg(mp->m_ddev_targp, 1);
994 992
995 xfs_unmountfs(mp); 993 xfs_unmountfs(mp);
994 xfs_syncd_stop(mp);
996 xfs_freesb(mp); 995 xfs_freesb(mp);
997 xfs_icsb_destroy_counters(mp); 996 xfs_icsb_destroy_counters(mp);
998 xfs_destroy_mount_workqueues(mp); 997 xfs_destroy_mount_workqueues(mp);
@@ -1362,31 +1361,32 @@ xfs_fs_fill_super(
1362 sb->s_time_gran = 1; 1361 sb->s_time_gran = 1;
1363 set_posix_acl_flag(sb); 1362 set_posix_acl_flag(sb);
1364 1363
1365 error = xfs_mountfs(mp); 1364 error = xfs_syncd_init(mp);
1366 if (error) 1365 if (error)
1367 goto out_filestream_unmount; 1366 goto out_filestream_unmount;
1368 1367
1369 error = xfs_syncd_init(mp); 1368 error = xfs_mountfs(mp);
1370 if (error) 1369 if (error)
1371 goto out_unmount; 1370 goto out_syncd_stop;
1372 1371
1373 root = igrab(VFS_I(mp->m_rootip)); 1372 root = igrab(VFS_I(mp->m_rootip));
1374 if (!root) { 1373 if (!root) {
1375 error = ENOENT; 1374 error = ENOENT;
1376 goto out_syncd_stop; 1375 goto out_unmount;
1377 } 1376 }
1378 if (is_bad_inode(root)) { 1377 if (is_bad_inode(root)) {
1379 error = EINVAL; 1378 error = EINVAL;
1380 goto out_syncd_stop; 1379 goto out_unmount;
1381 } 1380 }
1382 sb->s_root = d_make_root(root); 1381 sb->s_root = d_make_root(root);
1383 if (!sb->s_root) { 1382 if (!sb->s_root) {
1384 error = ENOMEM; 1383 error = ENOMEM;
1385 goto out_syncd_stop; 1384 goto out_unmount;
1386 } 1385 }
1387 1386
1388 return 0; 1387 return 0;
1389 1388 out_syncd_stop:
1389 xfs_syncd_stop(mp);
1390 out_filestream_unmount: 1390 out_filestream_unmount:
1391 xfs_filestream_unmount(mp); 1391 xfs_filestream_unmount(mp);
1392 out_free_sb: 1392 out_free_sb:
@@ -1403,8 +1403,6 @@ out_destroy_workqueues:
1403 out: 1403 out:
1404 return -error; 1404 return -error;
1405 1405
1406 out_syncd_stop:
1407 xfs_syncd_stop(mp);
1408 out_unmount: 1406 out_unmount:
1409 /* 1407 /*
1410 * Blow away any referenced inode in the filestreams cache. 1408 * Blow away any referenced inode in the filestreams cache.
@@ -1416,6 +1414,7 @@ out_destroy_workqueues:
1416 xfs_flush_buftarg(mp->m_ddev_targp, 1); 1414 xfs_flush_buftarg(mp->m_ddev_targp, 1);
1417 1415
1418 xfs_unmountfs(mp); 1416 xfs_unmountfs(mp);
1417 xfs_syncd_stop(mp);
1419 goto out_free_sb; 1418 goto out_free_sb;
1420} 1419}
1421 1420