diff options
author | kalash nainwal <kalash.nainwal@gmail.com> | 2007-05-08 03:28:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:08 -0400 |
commit | 98701d1b0fe98b477b53df89114e6862547f8107 (patch) | |
tree | 4ccfe162116056c1af41563ef4ea6c93bb7067f3 /fs/exec.c | |
parent | 0f95b7fc839bc3272b1bf2325d8748a649bd3534 (diff) |
(re)register_binfmt returns with -EBUSY
When a binary format is unregistered and re-registered, register_binfmt
fails with -EBUSY. The reason is that unregister_binfmt does not set
fmt->next to NULL, and seeing (fmt->next != NULL), register_binfmt fails
with -EBUSY.
One can find his way around by explicitly setting fmt->next to NULL after
unregistering, but that is kind of unclean (one should better be using only
the interfaces, and not the interal members, isn't it?)
Attached one-liner can fix it.
Signed-off-by: Kalash Nainwal <kalash.nainwal@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -100,6 +100,7 @@ int unregister_binfmt(struct linux_binfmt * fmt) | |||
100 | while (*tmp) { | 100 | while (*tmp) { |
101 | if (fmt == *tmp) { | 101 | if (fmt == *tmp) { |
102 | *tmp = fmt->next; | 102 | *tmp = fmt->next; |
103 | fmt->next = NULL; | ||
103 | write_unlock(&binfmt_lock); | 104 | write_unlock(&binfmt_lock); |
104 | return 0; | 105 | return 0; |
105 | } | 106 | } |