提交 e0d735c1 编写于 作者: C Chao Yu 提交者: Bob Peterson

gfs2: fix to detect failure of register_shrinker

register_shrinker can fail after commit 1d3d4437 ("vmscan: per-node
deferred work"), we should detect the failure of it, otherwise we may
fail to register shrinker after gfs2 module was been inited successfully.
Signed-off-by: NChao Yu <yuchao0@huawei.com>
Signed-off-by: NBob Peterson <rpeterso@redhat.com>
上级 23e5671a
...@@ -1781,7 +1781,13 @@ int __init gfs2_glock_init(void) ...@@ -1781,7 +1781,13 @@ int __init gfs2_glock_init(void)
return -ENOMEM; return -ENOMEM;
} }
register_shrinker(&glock_shrinker); ret = register_shrinker(&glock_shrinker);
if (ret) {
destroy_workqueue(gfs2_delete_workqueue);
destroy_workqueue(glock_workqueue);
rhashtable_destroy(&gl_hash_table);
return ret;
}
return 0; return 0;
} }
......
...@@ -145,7 +145,9 @@ static int __init init_gfs2_fs(void) ...@@ -145,7 +145,9 @@ static int __init init_gfs2_fs(void)
if (!gfs2_qadata_cachep) if (!gfs2_qadata_cachep)
goto fail; goto fail;
register_shrinker(&gfs2_qd_shrinker); error = register_shrinker(&gfs2_qd_shrinker);
if (error)
goto fail;
error = register_filesystem(&gfs2_fs_type); error = register_filesystem(&gfs2_fs_type);
if (error) if (error)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册