Whamcloud - gitweb
LU-4800 obdclass: runtime load lustre client when needed 87/10587/8
authorBob Glossman <bob.glossman@intel.com>
Wed, 4 Jun 2014 15:23:11 +0000 (08:23 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 16 Jun 2014 02:40:14 +0000 (02:40 +0000)
Manually force loading of lustre.ko during client
mounts with request_module for cases where
autoloading doesn't happen.

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I807fc5cd04cf5a97d9c131208b7b13037dc10ee6
Reviewed-on: http://review.whamcloud.com/10587
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/include/linux/lustre_compat25.h
lustre/obdclass/obd_mount.c

index 42092db..3dac0d1 100644 (file)
@@ -88,6 +88,10 @@ static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
 #define module_init(a)     late_initcall(a)
 #endif
 
 #define module_init(a)     late_initcall(a)
 #endif
 
+#ifndef MODULE_ALIAS_FS
+#define MODULE_ALIAS_FS(name)
+#endif
+
 #define LTIME_S(time)                   (time.tv_sec)
 
 #ifdef HAVE_GENERIC_PERMISSION_2ARGS
 #define LTIME_S(time)                   (time.tv_sec)
 
 #ifdef HAVE_GENERIC_PERMISSION_2ARGS
index 5cd96bf..b53ba84 100644 (file)
@@ -1294,7 +1294,9 @@ int lustre_fill_super(struct super_block *sb, void *data, int silent)
 
         if (lmd_is_client(lmd)) {
                 CDEBUG(D_MOUNT, "Mounting client %s\n", lmd->lmd_profile);
 
         if (lmd_is_client(lmd)) {
                 CDEBUG(D_MOUNT, "Mounting client %s\n", lmd->lmd_profile);
-                if (!client_fill_super) {
+               if (client_fill_super == NULL)
+                       request_module("lustre");
+               if (client_fill_super == NULL) {
                         LCONSOLE_ERROR_MSG(0x165, "Nothing registered for "
                                            "client mount! Is the 'lustre' "
                                            "module loaded?\n");
                         LCONSOLE_ERROR_MSG(0x165, "Nothing registered for "
                                            "client mount! Is the 'lustre' "
                                            "module loaded?\n");
@@ -1400,6 +1402,7 @@ struct file_system_type lustre_fs_type = {
        .fs_flags     = FS_BINARY_MOUNTDATA | FS_REQUIRES_DEV |
                        FS_HAS_FIEMAP | FS_RENAME_DOES_D_MOVE,
 };
        .fs_flags     = FS_BINARY_MOUNTDATA | FS_REQUIRES_DEV |
                        FS_HAS_FIEMAP | FS_RENAME_DOES_D_MOVE,
 };
+MODULE_ALIAS_FS("lustre");
 
 int lustre_register_fs(void)
 {
 
 int lustre_register_fs(void)
 {