Commit 2bcf6e97 authored by Christoph Hellwig's avatar Christoph Hellwig

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: default avatarChristoph Hellwig <hch@lst.de>
Reported-by: default avatarArkadiusz Miskiewicz <arekm@maven.pl>
Reviewed-by: default avatarAlex Elder <aelder@sgi.com>
parent b2ce3974
...@@ -1412,37 +1412,35 @@ xfs_fs_fill_super( ...@@ -1412,37 +1412,35 @@ xfs_fs_fill_super(
sb->s_time_gran = 1; sb->s_time_gran = 1;
set_posix_acl_flag(sb); set_posix_acl_flag(sb);
error = xfs_syncd_init(mp);
if (error)
goto out_filestream_unmount;
xfs_inode_shrinker_register(mp); xfs_inode_shrinker_register(mp);
error = xfs_mountfs(mp); error = xfs_mountfs(mp);
if (error) if (error)
goto out_syncd_stop; goto out_filestream_unmount;
error = xfs_syncd_init(mp);
if (error)
goto out_unmount;
root = igrab(VFS_I(mp->m_rootip)); root = igrab(VFS_I(mp->m_rootip));
if (!root) { if (!root) {
error = ENOENT; error = ENOENT;
goto fail_unmount; goto out_syncd_stop;
} }
if (is_bad_inode(root)) { if (is_bad_inode(root)) {
error = EINVAL; error = EINVAL;
goto fail_vnrele; goto out_syncd_stop;
} }
sb->s_root = d_alloc_root(root); sb->s_root = d_alloc_root(root);
if (!sb->s_root) { if (!sb->s_root) {
error = ENOMEM; error = ENOMEM;
goto fail_vnrele; goto out_iput;
} }
return 0; return 0;
out_syncd_stop:
xfs_inode_shrinker_unregister(mp);
xfs_syncd_stop(mp);
out_filestream_unmount: out_filestream_unmount:
xfs_inode_shrinker_unregister(mp);
xfs_filestream_unmount(mp); xfs_filestream_unmount(mp);
out_free_sb: out_free_sb:
xfs_freesb(mp); xfs_freesb(mp);
...@@ -1456,17 +1454,12 @@ xfs_fs_fill_super( ...@@ -1456,17 +1454,12 @@ xfs_fs_fill_super(
out: out:
return -error; return -error;
fail_vnrele: out_iput:
if (sb->s_root) { iput(root);
dput(sb->s_root); out_syncd_stop:
sb->s_root = NULL;
} else {
iput(root);
}
fail_unmount:
xfs_inode_shrinker_unregister(mp);
xfs_syncd_stop(mp); xfs_syncd_stop(mp);
out_unmount:
xfs_inode_shrinker_unregister(mp);
/* /*
* Blow away any referenced inode in the filestreams cache. * Blow away any referenced inode in the filestreams cache.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment