diff options
author | Lukas Czerner <lczerner@redhat.com> | 2011-02-03 14:33:33 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-02-03 14:33:33 -0500 |
commit | 8f021222c1e2756ea4c9dde93b23e1d2a0a4ec37 (patch) | |
tree | 8a74b91a0b1dd27fad9c384449bac0c4b8777a74 | |
parent | 8f1f745331c1b560f53c0d60e55a4f4f43f7cce5 (diff) |
ext4: unregister features interface on module unload
Ext4 features interface was not properly unregistered which led to
problems while unloading/reloading ext4 module. This commit fixes that by
adding proper kobject unregistration code into ext4_exit_fs() as well as
fail-path of ext4_init_fs()
Reported-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@kernel.org
-rw-r--r-- | fs/ext4/super.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 3d8cf2cab379..4898cb1ff606 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -4769,7 +4769,7 @@ static struct file_system_type ext4_fs_type = { | |||
4769 | .fs_flags = FS_REQUIRES_DEV, | 4769 | .fs_flags = FS_REQUIRES_DEV, |
4770 | }; | 4770 | }; |
4771 | 4771 | ||
4772 | int __init ext4_init_feat_adverts(void) | 4772 | static int __init ext4_init_feat_adverts(void) |
4773 | { | 4773 | { |
4774 | struct ext4_features *ef; | 4774 | struct ext4_features *ef; |
4775 | int ret = -ENOMEM; | 4775 | int ret = -ENOMEM; |
@@ -4793,6 +4793,13 @@ out: | |||
4793 | return ret; | 4793 | return ret; |
4794 | } | 4794 | } |
4795 | 4795 | ||
4796 | static void ext4_exit_feat_adverts(void) | ||
4797 | { | ||
4798 | kobject_put(&ext4_feat->f_kobj); | ||
4799 | wait_for_completion(&ext4_feat->f_kobj_unregister); | ||
4800 | kfree(ext4_feat); | ||
4801 | } | ||
4802 | |||
4796 | static int __init ext4_init_fs(void) | 4803 | static int __init ext4_init_fs(void) |
4797 | { | 4804 | { |
4798 | int err; | 4805 | int err; |
@@ -4839,7 +4846,7 @@ out1: | |||
4839 | out2: | 4846 | out2: |
4840 | ext4_exit_mballoc(); | 4847 | ext4_exit_mballoc(); |
4841 | out3: | 4848 | out3: |
4842 | kfree(ext4_feat); | 4849 | ext4_exit_feat_adverts(); |
4843 | remove_proc_entry("fs/ext4", NULL); | 4850 | remove_proc_entry("fs/ext4", NULL); |
4844 | kset_unregister(ext4_kset); | 4851 | kset_unregister(ext4_kset); |
4845 | out4: | 4852 | out4: |
@@ -4858,6 +4865,7 @@ static void __exit ext4_exit_fs(void) | |||
4858 | destroy_inodecache(); | 4865 | destroy_inodecache(); |
4859 | ext4_exit_xattr(); | 4866 | ext4_exit_xattr(); |
4860 | ext4_exit_mballoc(); | 4867 | ext4_exit_mballoc(); |
4868 | ext4_exit_feat_adverts(); | ||
4861 | remove_proc_entry("fs/ext4", NULL); | 4869 | remove_proc_entry("fs/ext4", NULL); |
4862 | kset_unregister(ext4_kset); | 4870 | kset_unregister(ext4_kset); |
4863 | ext4_exit_system_zone(); | 4871 | ext4_exit_system_zone(); |