Commit 7563ec4c authored by Hillf Danton's avatar Hillf Danton Committed by Linus Torvalds

hugetlbfs: remove unregister_filesystem() when initializing module

It was introduced by d1d5e05f ("hugetlbfs: return error code when
initializing module") but as Al pointed out, is a bad idea.

Quoted comments from Al:
 "Note that unregister_filesystem() in module init is *always* wrong;
  it's not an issue here (it's done too early to care about and
  realistically the box is not going anywhere - it'll panic when attempt
  to exec /sbin/init fails, if not earlier), but it's a damn bad

  Consider a normal fs module.  Somebody loads it and in parallel with
  that we get a mount attempt on that fs type.  It comes between
  register and failure exits that causes unregister; at that point we
  are screwed since grabbing a reference to module as done by mount is
  enough to prevent exit, but not to prevent the failure of init.  As
  the result, module will get freed when init fails, mounted fs of that
  type be damned."

So remove it.
Signed-off-by: default avatarHillf Danton <>
Cc: David Rientjes <>
Cc: Al Viro <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent fd835d1f
......@@ -1031,7 +1031,6 @@ static int __init init_hugetlbfs_fs(void)
error = PTR_ERR(vfsmount);
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