mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
xfs: list_lru_init returns a negative error
And we don't invert it properly when initialising the dquot lru list. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Jie Liu <jeff.liu@oracle.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
parent
bc147822d5
commit
ee4eec478b
1 changed files with 14 additions and 12 deletions
|
@ -843,22 +843,17 @@ xfs_qm_init_quotainfo(
|
||||||
|
|
||||||
qinf = mp->m_quotainfo = kmem_zalloc(sizeof(xfs_quotainfo_t), KM_SLEEP);
|
qinf = mp->m_quotainfo = kmem_zalloc(sizeof(xfs_quotainfo_t), KM_SLEEP);
|
||||||
|
|
||||||
if ((error = list_lru_init(&qinf->qi_lru))) {
|
error = -list_lru_init(&qinf->qi_lru);
|
||||||
kmem_free(qinf);
|
if (error)
|
||||||
mp->m_quotainfo = NULL;
|
goto out_free_qinf;
|
||||||
return error;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* See if quotainodes are setup, and if not, allocate them,
|
* See if quotainodes are setup, and if not, allocate them,
|
||||||
* and change the superblock accordingly.
|
* and change the superblock accordingly.
|
||||||
*/
|
*/
|
||||||
if ((error = xfs_qm_init_quotainos(mp))) {
|
error = xfs_qm_init_quotainos(mp);
|
||||||
list_lru_destroy(&qinf->qi_lru);
|
if (error)
|
||||||
kmem_free(qinf);
|
goto out_free_lru;
|
||||||
mp->m_quotainfo = NULL;
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
|
|
||||||
INIT_RADIX_TREE(&qinf->qi_uquota_tree, GFP_NOFS);
|
INIT_RADIX_TREE(&qinf->qi_uquota_tree, GFP_NOFS);
|
||||||
INIT_RADIX_TREE(&qinf->qi_gquota_tree, GFP_NOFS);
|
INIT_RADIX_TREE(&qinf->qi_gquota_tree, GFP_NOFS);
|
||||||
|
@ -935,6 +930,13 @@ xfs_qm_init_quotainfo(
|
||||||
qinf->qi_shrinker.flags = SHRINKER_NUMA_AWARE;
|
qinf->qi_shrinker.flags = SHRINKER_NUMA_AWARE;
|
||||||
register_shrinker(&qinf->qi_shrinker);
|
register_shrinker(&qinf->qi_shrinker);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
out_free_lru:
|
||||||
|
list_lru_destroy(&qinf->qi_lru);
|
||||||
|
out_free_qinf:
|
||||||
|
kmem_free(qinf);
|
||||||
|
mp->m_quotainfo = NULL;
|
||||||
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue