diff options
author | Christoph Hellwig <hch@lst.de> | 2011-07-13 07:43:48 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2011-07-13 07:43:48 -0400 |
commit | 2bcf6e970f5a88fa05dced5eeb0326e13d93c4a1 (patch) | |
tree | 5fb3e326ee8b06272490806fe493168299c3245a /fs/xfs/linux-2.6/xfs_super.c | |
parent | b2ce39740066604288876c752d8170b3b17a21aa (diff) |
xfs: start periodic workers later
Start the periodic sync workers only after we have finished xfs_mountfs
and thus fully set up the filesystem structures. Without this we can
call into xfs_qm_sync before the quotainfo strucute is set up if the
mount takes unusually long, and probably hit other incomplete states
as well.
Also clean up the xfs_fs_fill_super error path by using consistent
label names, and removing an impossible to reach case.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
Reviewed-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_super.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index a1a881e68a9a..3ebb4588e1be 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -1412,37 +1412,35 @@ xfs_fs_fill_super( | |||
1412 | sb->s_time_gran = 1; | 1412 | sb->s_time_gran = 1; |
1413 | set_posix_acl_flag(sb); | 1413 | set_posix_acl_flag(sb); |
1414 | 1414 | ||
1415 | error = xfs_syncd_init(mp); | ||
1416 | if (error) | ||
1417 | goto out_filestream_unmount; | ||
1418 | |||
1419 | xfs_inode_shrinker_register(mp); | 1415 | xfs_inode_shrinker_register(mp); |
1420 | 1416 | ||
1421 | error = xfs_mountfs(mp); | 1417 | error = xfs_mountfs(mp); |
1422 | if (error) | 1418 | if (error) |
1423 | goto out_syncd_stop; | 1419 | goto out_filestream_unmount; |
1420 | |||
1421 | error = xfs_syncd_init(mp); | ||
1422 | if (error) | ||
1423 | goto out_unmount; | ||
1424 | 1424 | ||
1425 | root = igrab(VFS_I(mp->m_rootip)); | 1425 | root = igrab(VFS_I(mp->m_rootip)); |
1426 | if (!root) { | 1426 | if (!root) { |
1427 | error = ENOENT; | 1427 | error = ENOENT; |
1428 | goto fail_unmount; | 1428 | goto out_syncd_stop; |
1429 | } | 1429 | } |
1430 | if (is_bad_inode(root)) { | 1430 | if (is_bad_inode(root)) { |
1431 | error = EINVAL; | 1431 | error = EINVAL; |
1432 | goto fail_vnrele; | 1432 | goto out_syncd_stop; |
1433 | } | 1433 | } |
1434 | sb->s_root = d_alloc_root(root); | 1434 | sb->s_root = d_alloc_root(root); |
1435 | if (!sb->s_root) { | 1435 | if (!sb->s_root) { |
1436 | error = ENOMEM; | 1436 | error = ENOMEM; |
1437 | goto fail_vnrele; | 1437 | goto out_iput; |
1438 | } | 1438 | } |
1439 | 1439 | ||
1440 | return 0; | 1440 | return 0; |
1441 | 1441 | ||
1442 | out_syncd_stop: | ||
1443 | xfs_inode_shrinker_unregister(mp); | ||
1444 | xfs_syncd_stop(mp); | ||
1445 | out_filestream_unmount: | 1442 | out_filestream_unmount: |
1443 | xfs_inode_shrinker_unregister(mp); | ||
1446 | xfs_filestream_unmount(mp); | 1444 | xfs_filestream_unmount(mp); |
1447 | out_free_sb: | 1445 | out_free_sb: |
1448 | xfs_freesb(mp); | 1446 | xfs_freesb(mp); |
@@ -1456,17 +1454,12 @@ xfs_fs_fill_super( | |||
1456 | out: | 1454 | out: |
1457 | return -error; | 1455 | return -error; |
1458 | 1456 | ||
1459 | fail_vnrele: | 1457 | out_iput: |
1460 | if (sb->s_root) { | 1458 | iput(root); |
1461 | dput(sb->s_root); | 1459 | out_syncd_stop: |
1462 | sb->s_root = NULL; | ||
1463 | } else { | ||
1464 | iput(root); | ||
1465 | } | ||
1466 | |||
1467 | fail_unmount: | ||
1468 | xfs_inode_shrinker_unregister(mp); | ||
1469 | xfs_syncd_stop(mp); | 1460 | xfs_syncd_stop(mp); |
1461 | out_unmount: | ||
1462 | xfs_inode_shrinker_unregister(mp); | ||
1470 | 1463 | ||
1471 | /* | 1464 | /* |
1472 | * Blow away any referenced inode in the filestreams cache. | 1465 | * Blow away any referenced inode in the filestreams cache. |