Whamcloud - gitweb
Branch b1_4_newconfig2
authornathan <nathan>
Wed, 10 Aug 2005 23:43:07 +0000 (23:43 +0000)
committernathan <nathan>
Wed, 10 Aug 2005 23:43:07 +0000 (23:43 +0000)
b=6663
fixup mntget and mntput

lustre/include/linux/lustre_disk.h
lustre/mds/handler.c
lustre/mds/mds_lov.c
lustre/mgc/mgc_request.c
lustre/mgs/mgs_fs.c
lustre/obdclass/llog_lvfs.c
lustre/obdclass/obd_mount.c
lustre/obdfilter/filter.c
lustre/utils/mkfs_lustre.c
lustre/utils/module_setup.sh
lustre/utils/rmmod_all.sh

index 4cae445..443c257 100644 (file)
@@ -220,7 +220,7 @@ void lustre_register_client_fill_super(int (*cfs)(struct super_block *sb));
 void lustre_common_put_super(struct super_block *sb);
 int class_manual_cleanup(struct obd_device *obd, char *flags);
 struct lustre_mount_info *lustre_get_mount(char *name);
-struct lustre_mount_info *lustre_put_mount(char *name);
+int lustre_put_mount(char *name);
 
 #endif
 
index 1e24963..762577d 100644 (file)
@@ -1597,6 +1597,7 @@ err_put:
         if (lmi) {
                 lustre_put_mount(obd->obd_name);
         } else {
+                /* old method */
                 unlock_kernel();
                 mntput(mds->mds_vfsmnt);
                 lock_kernel();
@@ -1776,6 +1777,7 @@ static int mds_cleanup(struct obd_device *obd)
 {
         struct mds_obd *mds = &obd->u.mds;
         lvfs_sbdev_type save_dev;
+        int must_put = 0;
         int must_relock = 0;
         ENTRY;
 
@@ -1807,14 +1809,18 @@ static int mds_cleanup(struct obd_device *obd)
                 CERROR("%s: mount busy, mnt_count %d != 2\n", obd->obd_name,
                        atomic_read(&obd->u.mds.mds_vfsmnt->mnt_count));
 
+        must_put = lustre_put_mount(obd->obd_name);
+
         /* We can only unlock kernel if we are in the context of sys_ioctl,
            otherwise we never called lock_kernel */
         if (kernel_locked()) {
                 unlock_kernel();
                 must_relock++;
         }
-
-        mntput(mds->mds_vfsmnt);
+        
+        if (must_put) 
+                /* In case we didn't mount with lustre_get_mount -- old method*/
+                mntput(mds->mds_vfsmnt);
         mds->mds_sb = NULL;
 
         ldlm_namespace_free(obd->obd_namespace, obd->obd_force);
index 773165f..f2da53c 100644 (file)
@@ -195,6 +195,7 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name)
                 GOTO(err_reg, rc);
         }
 
+        /* tgt_count may be 0! */
         rc = llog_cat_initialize(obd, mds->mds_lov_desc.ld_tgt_count);
         if (rc) {
                 CERROR("failed to initialize catalog %d\n", rc);
index 3f7d04e..fdc5845 100644 (file)
 #include "mgc_internal.h"
 
           
-static int mgc_fs_setup(struct super_block *sb, struct vfsmount *mnt)
+static int mgc_fs_setup(struct obd_device *obd, struct super_block *sb, 
+                        struct vfsmount *mnt)
 {
         struct lvfs_run_ctxt saved;
         struct lustre_sb_info *sbi = s2sbi(sb);
-        struct obd_device *obd = sbi->lsi_mgc;
         struct mgc_obd *mgcobd = &obd->u.mgc;
         struct dentry *dentry;
         int err = 0;
 
-        LASSERT(obd);
+        LASSERT(sbi);
 
         obd->obd_fsops = fsfilt_get_ops(MT_STR(sbi->lsi_ldd));
         if (IS_ERR(obd->obd_fsops)) {
@@ -70,7 +70,9 @@ static int mgc_fs_setup(struct super_block *sb, struct vfsmount *mnt)
         }
 
         mgcobd->mgc_vfsmnt = mnt;
-        mgcobd->mgc_sb = mnt->mnt_root->d_inode->i_sb; // is this different than sb? */
+        mgcobd->mgc_sb = mnt->mnt_root->d_inode->i_sb;
+        // FIXME which one? - filter_common_setup also 
+        CERROR("SB's: fill=%p mnt=%p root=%p\n", sb, mnt->mnt_sb, mnt->mnt_root->d_inode->i_sb);
         fsfilt_setup(obd, mgcobd->mgc_sb);
 
         OBD_SET_CTXT_MAGIC(&obd->obd_lvfs_ctxt);
@@ -113,10 +115,7 @@ static int mgc_fs_cleanup(struct obd_device *obd)
                 pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
         }
 
-        if (mgc->mgc_vfsmnt)
-                // FIXME mntput should not be done by real server, only us 
-                // FIXME or mntcount on sbi?
-                mntput(mgc->mgc_vfsmnt);
+        mgc->mgc_vfsmnt = NULL;
         mgc->mgc_sb = NULL;
         
         if (obd->obd_fsops) 
@@ -135,17 +134,16 @@ static int mgc_cleanup(struct obd_device *obd)
         if (rc != 0)
                 CERROR("failed to cleanup llogging subsystems\n");
 
-
-        if (mgc->mgc_sb)
-                /* if we're a server, eg. something's mounted */
-                mgc_fs_cleanup(obd);
-
         //lprocfs_obd_cleanup(obd);
         
         //rc = mgc_obd_cleanup(obd);
-        
-        if (!lustre_put_mount(obd->obd_name))
-             CERROR("mount_put failed\n");
+
+        if (mgc->mgc_vfsmnt) {
+                /* if we're a server, eg. something's mounted */
+                mgc_fs_cleanup(obd);
+                if ((rc = lustre_put_mount(obd->obd_name)))
+                     CERROR("mount_put failed %d\n", rc);
+        }
 
         ptlrpcd_decref();
         
@@ -157,7 +155,6 @@ static int mgc_cleanup(struct obd_device *obd)
 static int mgc_setup(struct obd_device *obd, obd_count len, void *buf)
 {
         struct lustre_mount_info *lmi;
-        struct lustre_sb_info *sbi;
         struct mgc_obd *mgc = &obd->u.mgc;
         //struct lprocfs_static_vars lvars;
         int rc;
@@ -185,21 +182,18 @@ static int mgc_setup(struct obd_device *obd, obd_count len, void *buf)
         }
 
         lmi = lustre_get_mount(obd->obd_name);
-        if (!lmi) {
-                CERROR("No mount registered!");
-                mgc_cleanup(obd);
-                RETURN(-ENOENT);
-        }
-
-        sbi = s2sbi(lmi->lmi_sb);
-        sbi->lsi_mgc = obd; 
-
-        rc = mgc_fs_setup(lmi->lmi_sb, lmi->lmi_mnt);
-        if (rc) {
-                CERROR("fs setup failed %d\n", rc);
-                mgc_cleanup(obd);
-                RETURN(-ENOENT);
-                GOTO(err_rpc_lock, rc);
+        if (lmi) {
+                CERROR("mgc has local disk\n");
+                /* there's a local disk, we must get access */
+                rc = mgc_fs_setup(obd, lmi->lmi_sb, lmi->lmi_mnt);
+                if (rc) {
+                        CERROR("fs setup failed %d\n", rc);
+                        mgc_cleanup(obd);
+                        RETURN(-ENOENT);
+                        GOTO(err_rpc_lock, rc);
+                }                                                                                                     
+        } else {
+                CERROR("mgc does not have local disk (client only)\n");
         }
 
         RETURN(rc);
@@ -248,7 +242,6 @@ static int mgc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
 #endif
         /* ORIGinator context */
         case OBD_IOC_DUMP_LOG: {
-                struct lvfs_run_ctxt saved;
                 ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
                 push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
                 rc = class_config_dump_llog(ctxt, data->ioc_inlbuf1, NULL);
index d5f8a51..b401ef4 100644 (file)
@@ -71,10 +71,11 @@ int mgs_fs_setup(struct obd_device *obd, struct vfsmount *mnt)
         /* setup the directory tree */
         push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
 
-        dentry = simple_mkdir(current->fs->pwd, "CONFIGS", 0777, 1);
+        dentry = simple_mkdir(current->fs->pwd, MOUNT_CONFIGS_DIR, 0777, 1);
         if (IS_ERR(dentry)) 
                 rc = PTR_ERR(dentry);
-                CERROR("cannot create CONFIGS directory: rc = %d\n", rc);
+                CERROR("cannot create %s directory: rc = %d\n", 
+                       MOUNT_CONFIGS_DIR, rc);
                 GOTO(err_pop, rc);
         }
 
index deaa93f..772e801 100644 (file)
@@ -434,14 +434,15 @@ static struct file *llog_filp_open(char* fsname, char *name,
                 return ERR_PTR(-ENOMEM); 
 //FIXME: Need to changing mkfs
 //        if (fsname)
-//              len = snprintf(logname, PATH_MAX, "CONFIGS/%s/%s", fsname, name);
+//              len = snprintf(logname, PATH_MAX, "%s/%s/%s", MOUNT_CONFIGS_DIR, fsname, name);
 //        else
-              len = snprintf(logname, PATH_MAX, "CONFIGS/%s", name);
+              len = snprintf(logname, PATH_MAX, "%s/%s", 
+                             MOUNT_CONFIGS_DIR, name);
 
         if (len >= PATH_MAX - 1) {
                 filp = ERR_PTR(-ENAMETOOLONG);
         } else {
-                printk("logname = %s\n", logname);
+                CERROR("logname = %s\n", logname);
                 filp = l_filp_open(logname, flags, mode);
                 if (IS_ERR(filp))
                         CERROR("logfile creation %s: %ld\n", logname,
@@ -626,7 +627,10 @@ int llog_get_cat_list(struct obd_device *obd, struct obd_device *disk_obd,
         int size = sizeof(*idarray) * count;
         loff_t off = 0;
 
-        LASSERT(count);
+        if (!count) {
+                CERROR("Empty catalog?\n");
+                RETURN(0);
+        }
 
         push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
         file = filp_open(name, O_RDWR | O_CREAT | O_LARGEFILE, 0700);
@@ -668,8 +672,11 @@ int llog_put_cat_list(struct obd_device *obd, struct obd_device *disk_obd,
         int size = sizeof(*idarray) * count;
         loff_t off = 0;
 
-        LASSERT(count);
-
+        if (!count) {
+                CERROR("Empty catalog?\n");
+                RETURN(0);
+        }
+        
         push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
         file = filp_open(name, O_RDWR | O_CREAT | O_LARGEFILE, 0700);
         if (!file || IS_ERR(file)) {
index db37922..29e8973 100644 (file)
@@ -63,6 +63,8 @@ int lustre_register_mount(char *name, struct super_block *sb,
         struct lustre_mount_info *lmi;
         char *name_cp;
 
+        CERROR("register %s\n", name);
+
         OBD_ALLOC(lmi, sizeof(*lmi));
         if (!lmi) 
                 return -ENOMEM;
@@ -71,7 +73,7 @@ int lustre_register_mount(char *name, struct super_block *sb,
                 OBD_FREE(lmi, sizeof(*lmi));
                 return -ENOMEM;
         }
-        memcpy(name_cp, name, strlen(name));
+        strcpy(name_cp, name);
 
         down(&lustre_mount_info_lock);
         if (lustre_find_mount(name)) {
@@ -94,6 +96,8 @@ static int lustre_deregister_mount(char *name)
 {
         struct lustre_mount_info *lmi;
         
+        CERROR("deregister %s\n", name);
+
         down(&lustre_mount_info_lock);
         lmi = lustre_find_mount(name);
         if (!lmi) {
@@ -108,7 +112,8 @@ static int lustre_deregister_mount(char *name)
         return 0;
 }
 
-/* obd's look up a registered mount using their name */
+/* obd's look up a registered mount using their name. This is just
+   for initial setup; should not be called every time you want to mntget */
 struct lustre_mount_info *lustre_get_mount(char *name)
 {
         struct lustre_mount_info *lmi;
@@ -122,13 +127,26 @@ struct lustre_mount_info *lustre_get_mount(char *name)
                 return NULL;
         }
         sbi = s2sbi(lmi->lmi_sb);
+        mntget(lmi->lmi_mnt);
         atomic_inc(&sbi->lsi_mounts);
         up(&lustre_mount_info_lock);
         CERROR("got mount for %s\n", name);
         return lmi;
 }
 
-struct lustre_mount_info *lustre_put_mount(char *name)
+static void unlock_mntput(struct vfsmount *mnt)
+{
+        if (kernel_locked()) {
+                unlock_kernel();
+                mntput(mnt);
+                lock_kernel();
+        } else {
+                mntput(mnt);
+        }
+}
+
+/* to be called from obd_cleanup methods */
+int lustre_put_mount(char *name)
 {
         struct lustre_mount_info *lmi;
         struct lustre_sb_info *sbi;
@@ -138,25 +156,23 @@ struct lustre_mount_info *lustre_put_mount(char *name)
         if (!lmi) {
                 up(&lustre_mount_info_lock);
                 CERROR("Can't find mount for %s\n", name);
-                return NULL;
+                return -ENOENT;
         }
         sbi = s2sbi(lmi->lmi_sb);
+        unlock_mntput(lmi->lmi_mnt);
         if (atomic_dec_and_test(&sbi->lsi_mounts)) {
-                CERROR("Last put of mnt %p from %s\n", lmi->lmi_mnt, name);
-                if (kernel_locked()) {
-                        unlock_kernel();
-                        mntput(lmi->lmi_mnt);
-                        lock_kernel();
-                } else {
-                        mntput(lmi->lmi_mnt);
-                }
+                /* The mntput from lustre_kern_mount */
+                unlock_mntput(lmi->lmi_mnt);
+                CERROR("Last put of mnt %p from %s, mount count %d\n", 
+                       lmi->lmi_mnt, name, 
+                       atomic_read(&lmi->lmi_mnt->mnt_count));
         }
         up(&lustre_mount_info_lock);
 
-        /* any reason why a server might need the mount again? */
+        /* this obd should never need the mount again */
         lustre_deregister_mount(name);
         
-        return lmi;
+        return 0;
 }
 
 
@@ -531,7 +547,8 @@ static int lustre_start_mgc(char *mgcname, struct super_block *sb)
                 err = -ENOTCONN;
                 goto out_free;
         }
-        
+        sbi->lsi_mgc = obd;
+
 out_free:
         return err;
 }
@@ -638,9 +655,7 @@ static struct vfsmount *lustre_kern_mount(struct super_block *sb)
         //mount_ctxt.cb_ops = mds_lvfs_ops;
 
         err = parse_mount_data(&mount_ctxt, ldd); 
-        //unlock_kernel();
-        mntput(mnt);
-        //lock_kernel();
+        unlock_mntput(mnt);
 
         if (err) {
                 CERROR("premount parse options failed: err = %d\n", err);
@@ -845,7 +860,7 @@ static int server_fill_super(struct super_block *sb)
         if (IS_ERR(mnt)) {
                 CERROR("Unable to mount device %s: %d\n", 
                       sbi->lsi_lmd->lmd_dev, err);
-                GOTO(out_free, err = PTR_ERR(mnt));
+                GOTO(out, err = PTR_ERR(mnt));
         }
         LASSERT(sbi->lsi_ldd);
         CERROR("Found service %s for fs %s on device %s\n",
@@ -855,17 +870,17 @@ static int server_fill_super(struct super_block *sb)
         /* register a mount for the mgc so it can call mgc_fs_setup() */
         err = lustre_register_mount(mgcname, sb, mnt);
         if (err) 
-                GOTO(out_free, err);
+                GOTO(out, err);
 
         err = lustre_start_mgc(mgcname, sb);
         //part of mgc_startup err = mgc_fs_setup(sb, mnt);
         if (err) 
-                GOTO(out_free, err);
+                GOTO(out_dereg, err);
         
         /* we also need to register a mount for the real server */
         err = lustre_register_mount(sbi->lsi_ldd->ldd_svname, sb, mnt);
         if (err) 
-                GOTO(out_free, err);
+                GOTO(out_dereg, err);
 
 
         if (sbi->lsi_ldd->ldd_flags & LDD_F_NEED_INDEX) {
@@ -881,24 +896,30 @@ static int server_fill_super(struct super_block *sb)
         err = lustre_process_logs(sb, &cfg, 0);
         if (err < 0) {
                 CERROR("Unable to process log: %d\n", err);
-                GOTO(out_free, err);
+                GOTO(out_dereg, err);
         }
         
         /* Finally, put something at the mount point. */
         CERROR("Mounting server\n");
         err = server_fill_super_common(sb);
-       
+        if (err) 
+                GOTO(out_dereg, err);
+
         /* FIXME overmount client here,
            or can we just start a client log and client_fill_super on this sb? 
            have to fix up the s_ops after! */
-out_free:
-        //FIXME mntput
-        //FIXME manual_cleanup (server_put_super)
-        OBD_FREE(mgcname, mgcname_sz);
 out:
+        //FIXME mntput
+        if (mgcname)
+                OBD_FREE(mgcname, mgcname_sz);
         if (sbi->lsi_ldd)
+                // FIXME ??
                 class_del_profile(sbi->lsi_ldd->ldd_svname);
         RETURN(err);
+out_dereg:
+        lustre_deregister_mount(mgcname);
+        lustre_deregister_mount(sbi->lsi_ldd->ldd_svname);
+        goto out;     
 }
 
 
index 7391be8..c3d533e 100644 (file)
@@ -1205,6 +1205,7 @@ int filter_common_setup(struct obd_device *obd, obd_count len, void *buf,
         struct lustre_cfg* lcfg = buf;
         struct filter_obd *filter = &obd->u.filter;
         struct vfsmount *mnt;
+        struct lustre_mount_info *lmi;
         char *str;
         char ns_name[48];
         int rc = 0;
@@ -1218,9 +1219,16 @@ int filter_common_setup(struct obd_device *obd, obd_count len, void *buf,
         obd->obd_fsops = fsfilt_get_ops(lustre_cfg_string(lcfg, 2));
         if (IS_ERR(obd->obd_fsops))
                 RETURN(PTR_ERR(obd->obd_fsops));
-
-        mnt = do_kern_mount(lustre_cfg_string(lcfg, 2),MS_NOATIME|MS_NODIRATIME,
-                            lustre_cfg_string(lcfg, 1), option);
+        
+        lmi = lustre_get_mount(obd->obd_name);
+        if (lmi) {
+                /* We already mounted in lustre_fill_super */
+                mnt = lmi->lmi_mnt;
+        } else {
+                mnt = do_kern_mount(lustre_cfg_string(lcfg, 2),
+                                    MS_NOATIME|MS_NODIRATIME,
+                                    lustre_cfg_string(lcfg, 1), option);       
+        }
         rc = PTR_ERR(mnt);
         if (IS_ERR(mnt))
                 GOTO(err_ops, rc);
@@ -1329,10 +1337,15 @@ int filter_common_setup(struct obd_device *obd, obd_count len, void *buf,
 err_post:
         filter_post(obd);
 err_mntput:
-        unlock_kernel();
-        mntput(mnt);
+        if (lmi) {
+                lustre_put_mount(obd->obd_name);
+        } else {
+                /* old method */
+                unlock_kernel();
+                mntput(mnt);
+                lock_kernel();
+        }
         filter->fo_sb = 0;
-        lock_kernel();
 err_ops:
         fsfilt_put_ops(obd->obd_fsops);
         return rc;
@@ -1448,7 +1461,7 @@ static int filter_cleanup(struct obd_device *obd)
 {
         struct filter_obd *filter = &obd->u.filter;
         lvfs_sbdev_type save_dev;
-        int must_relock = 0;
+        int must_relock = 0, must_put = 0;
         ENTRY;
 
         if (obd->obd_fail)
@@ -1488,6 +1501,8 @@ static int filter_cleanup(struct obd_device *obd)
                        obd->obd_name, filter->fo_vfsmnt,
                        atomic_read(&filter->fo_vfsmnt->mnt_count));
 
+        must_put = lustre_put_mount(obd->obd_name);
+
         /* We can only unlock kernel if we are in the context of sys_ioctl,
            otherwise we never called lock_kernel */
         if (kernel_locked()) {
@@ -1495,7 +1510,8 @@ static int filter_cleanup(struct obd_device *obd)
                 must_relock++;
         }
         
-        mntput(filter->fo_vfsmnt);
+        if (must_put) 
+                mntput(filter->fo_vfsmnt);
         //destroy_buffers(filter->fo_sb->s_dev);
         filter->fo_sb = NULL;
 
index 113fb40..7037224 100644 (file)
@@ -426,6 +426,7 @@ int make_lustre_backfs(struct mkfs_opts *mop)
                 }           
 
                 if (strstr(mop->mo_mkfsopts, "-J") == NULL) {
+                        /* Choose our own default journal size */
                         long journal_sz = 0;
                         if (device_sz > 1024 * 1024) 
                                 journal_sz = (device_sz / 102400) * 4;
@@ -437,24 +438,45 @@ int make_lustre_backfs(struct mkfs_opts *mop)
                         }
                 }
 
+                /* Default is block size */
                 if (strstr(mop->mo_mkfsopts, "-i") == NULL) {
-                        long inode_sz = 0;
+                        long bytes_per_inode = 0;
+                                        
+                        if (IS_MDT(&mop->mo_ldd)) 
+                                bytes_per_inode = 4096;
+
+                        /* Allocate fewer inodes on large OST devices.  Most
+                           filesystems can be much more aggressive than even 
+                           this. */
+                        if ((IS_OST(&mop->mo_ldd) && (device_sz > 1000000))) 
+                                bytes_per_inode = 16384;
                         
-                       /* The larger the bytes-per-inode ratio, the fewer
-                          inodes will  be  created. */
-                        if (mop->mo_stripe_count > 77)
-                                inode_sz = 4096;
-                        else if (mop->mo_stripe_count > 35)
-                                inode_sz = 2048;
-                        else if (IS_MDT(&mop->mo_ldd)) 
-                                inode_sz = 1024;
-                        else if ((IS_OST(&mop->mo_ldd) && (device_sz > 1000000))) 
-                                  inode_sz = 16384;
-                        if (inode_sz > 0) {
-                                sprintf(buf, " -i %ld", inode_sz);
+                        if (bytes_per_inode > 0) {
+                                sprintf(buf, " -i %ld", bytes_per_inode);
                                 strcat(mop->mo_mkfsopts, buf);
                         }
                 }
+                
+                /* This is an undocumented mke2fs option. Default is 128. */
+                if (strstr(mop->mo_mkfsopts, "-I") == NULL) {
+                        long inode_size = 0;
+                        if (IS_MDT(&mop->mo_ldd)) {
+                                if (mop->mo_stripe_count > 77)
+                                        inode_size = 512; /* bz 7241 */
+                                else if (mop->mo_stripe_count > 34)
+                                        inode_size = 2048;
+                                else if (mop->mo_stripe_count > 13)
+                                        inode_size = 1024;
+                                else 
+                                        inode_size = 512;
+                        }
+                        
+                        if (inode_size > 0) {
+                                sprintf(buf, " -I %ld", inode_size);
+                                strcat(mop->mo_mkfsopts, buf);
+                        }
+                        
+                }
 
                 sprintf(mkfs_cmd, "mkfs.ext2 -j -b 4096 -L %s ",
                         mop->mo_ldd.ldd_svname);
@@ -671,6 +693,11 @@ int write_llog_files(struct mkfs_opts *mop)
         if ((ret = jt_setup()))
                 return ret;
         
+        /* debug info */
+        if (verbose >= 2) {
+                do_jt_noret(jt_dbg_modules, "modules", 0);
+        }
+
         dev = mop->mo_device;
         if (mop->mo_flags & MO_IS_LOOP) {
                 ret = loop_setup(mop);
index c056927..483a662 100755 (executable)
@@ -51,19 +51,19 @@ if [ `grep -c lustre $MODFILE` -eq 0 ]; then
     echo Modifying $MODFILE
     echo "# Lustre modules added by $0" >> $MODFILE
     if [ $KVER -eq 24 ]; then
-       echo alias _lustre portals >> $MODFILE
-       echo add above _lustre ksocknal $FSFLT >> $MODFILE
-       echo add below mds _lustre osc >> $MODFILE
+       echo alias _lustre ksocknal >> $MODFILE
+       echo add above _lustre mgc $FSFLT portals >> $MODFILE
+       echo add below mds _lustre osc lov >> $MODFILE
        echo add below ost _lustre >> $MODFILE
-       echo add below llite _lustre osc mdc >> $MODFILE
+       echo add below llite _lustre osc mdc lov >> $MODFILE
        echo alias lustre llite >> $MODFILE
     else
        echo "install kptlrouter $MP portals && $MPI kptlrouter" >> $MODFILE
-       echo "install _lustre $MP portals && $MP lvfs && $MP obdclass && $MP ptlrpc" >> $MODFILE
+       echo "install _lustre $MP portals && $MP lvfs && $MP obdclass && $MP ptlrpc && $MP mgc" >> $MODFILE
        echo "install obdfilter $MP _lustre && $MP ost && $MP ldiskfs && $MP $FSFLT && $MPI obdfilter" >> $MODFILE
        echo "install ost $MP _lustre && $MPI ost" >> $MODFILE
-       echo "install mds $MP _lustre && $MP osc && $MPI mds" >> $MODFILE
-       echo "install llite $MP _lustre && $MP osc && $MP mdc && $MPI llite" >> $MODFILE
+       echo "install mds $MP _lustre && $MP osc && $MP lov && $MPI mds" >> $MODFILE
+       echo "install llite $MP _lustre && $MP osc && $MP mdc && $MP lov && $MPI llite" >> $MODFILE
        echo "alias lustre llite" >> $MODFILE
     fi
     echo "# end Lustre modules" >> $MODFILE
index 34dafce..ff25383 100755 (executable)
@@ -9,6 +9,7 @@ rmmod fsfilt_ext3
 rmmod fsfilt_ldiskfs
 rmmod ldiskfs
 rmmod mgc
+rmmod mgs
 rmmod ost
 rmmod mds
 rmmod ptlrpc