From: Bob Glossman Date: Wed, 4 Jun 2014 15:23:11 +0000 (-0700) Subject: LU-4800 obdclass: runtime load lustre client when needed X-Git-Tag: 2.6.0-RC1~104 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=5d3b979bc49b7adbb066b7097749254e2fc28e43 LU-4800 obdclass: runtime load lustre client when needed Manually force loading of lustre.ko during client mounts with request_module for cases where autoloading doesn't happen. Signed-off-by: Bob Glossman Change-Id: I807fc5cd04cf5a97d9c131208b7b13037dc10ee6 Reviewed-on: http://review.whamcloud.com/10587 Reviewed-by: John L. Hammond Reviewed-by: James Simmons Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Yang Sheng Reviewed-by: Andreas Dilger --- diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index 42092db..3dac0d1 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -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 +#ifndef MODULE_ALIAS_FS +#define MODULE_ALIAS_FS(name) +#endif + #define LTIME_S(time) (time.tv_sec) #ifdef HAVE_GENERIC_PERMISSION_2ARGS diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 5cd96bf..b53ba84 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -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 (!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"); @@ -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, }; +MODULE_ALIAS_FS("lustre"); int lustre_register_fs(void) {