Skip to content

Commit 2bcf6e9

Browse files
author
Christoph Hellwig
committed
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 <[email protected]> Reported-by: Arkadiusz Miskiewicz <[email protected]> Reviewed-by: Alex Elder <[email protected]>
1 parent b2ce397 commit 2bcf6e9

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

fs/xfs/linux-2.6/xfs_super.c

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,37 +1412,35 @@ xfs_fs_fill_super(
14121412
sb->s_time_gran = 1;
14131413
set_posix_acl_flag(sb);
14141414

1415-
error = xfs_syncd_init(mp);
1416-
if (error)
1417-
goto out_filestream_unmount;
1418-
14191415
xfs_inode_shrinker_register(mp);
14201416

14211417
error = xfs_mountfs(mp);
14221418
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;
14241424

14251425
root = igrab(VFS_I(mp->m_rootip));
14261426
if (!root) {
14271427
error = ENOENT;
1428-
goto fail_unmount;
1428+
goto out_syncd_stop;
14291429
}
14301430
if (is_bad_inode(root)) {
14311431
error = EINVAL;
1432-
goto fail_vnrele;
1432+
goto out_syncd_stop;
14331433
}
14341434
sb->s_root = d_alloc_root(root);
14351435
if (!sb->s_root) {
14361436
error = ENOMEM;
1437-
goto fail_vnrele;
1437+
goto out_iput;
14381438
}
14391439

14401440
return 0;
14411441

1442-
out_syncd_stop:
1443-
xfs_inode_shrinker_unregister(mp);
1444-
xfs_syncd_stop(mp);
14451442
out_filestream_unmount:
1443+
xfs_inode_shrinker_unregister(mp);
14461444
xfs_filestream_unmount(mp);
14471445
out_free_sb:
14481446
xfs_freesb(mp);
@@ -1456,17 +1454,12 @@ xfs_fs_fill_super(
14561454
out:
14571455
return -error;
14581456

1459-
fail_vnrele:
1460-
if (sb->s_root) {
1461-
dput(sb->s_root);
1462-
sb->s_root = NULL;
1463-
} else {
1464-
iput(root);
1465-
}
1466-
1467-
fail_unmount:
1468-
xfs_inode_shrinker_unregister(mp);
1457+
out_iput:
1458+
iput(root);
1459+
out_syncd_stop:
14691460
xfs_syncd_stop(mp);
1461+
out_unmount:
1462+
xfs_inode_shrinker_unregister(mp);
14701463

14711464
/*
14721465
* Blow away any referenced inode in the filestreams cache.

0 commit comments

Comments
 (0)