From 5b828dd656cc9f59ac34bacec6fcab5d92850a8c Mon Sep 17 00:00:00 2001 From: fanyong Date: Thu, 12 Oct 2006 16:08:22 +0000 Subject: [PATCH] Roll back for the change of server_put_mount. Use server_get_mount_2 instead of server_get_mount. --- lustre/include/lustre_disk.h | 2 ++ lustre/mdt/mdt_handler.c | 18 +++++++++++------- lustre/obdclass/obd_mount.c | 33 ++++++++++++++++++++++++++++++--- 3 files changed, 43 insertions(+), 10 deletions(-) diff --git a/lustre/include/lustre_disk.h b/lustre/include/lustre_disk.h index 9e71c09..55cf2a4 100644 --- a/lustre/include/lustre_disk.h +++ b/lustre/include/lustre_disk.h @@ -274,7 +274,9 @@ int lustre_process_log(struct super_block *sb, char *logname, int lustre_end_log(struct super_block *sb, char *logname, struct config_llog_instance *cfg); struct lustre_mount_info *server_get_mount(const char *name); +struct lustre_mount_info *server_get_mount_2(const char *name); int server_put_mount(const char *name, struct vfsmount *mnt); +int server_put_mount_2(const char *name, struct vfsmount *mnt); int server_register_target(struct super_block *sb); struct mgs_target_info; int server_mti_print(char *title, struct mgs_target_info *mti); diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 659e397..8c92795 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -3251,7 +3251,9 @@ static void fsoptions_to_mdt_flags(struct mdt_device *m, char *options) m->mdt_opts.mo_acl = 1; LCONSOLE_INFO("Enabling ACL\n"); #else + m->mdt_opts.mo_acl = 0; CWARN("ignoring unsupported acl mount option\n"); + LCONSOLE_INFO("Disabling ACL\n"); #endif } else if ((len == sizeof("noacl") - 1) && (memcmp(options, "noacl", len) == 0)) { @@ -3292,16 +3294,18 @@ static int mdt_init0(const struct lu_env *env, struct mdt_device *m, m->mdt_max_mdsize = MAX_MD_SIZE; m->mdt_max_cookiesize = sizeof(struct llog_cookie); - lmi = server_get_mount(dev); + m->mdt_opts.mo_user_xattr = 0; + m->mdt_opts.mo_acl = 0; + lmi = server_get_mount_2(dev); if (lmi == NULL) { - CERROR("Cannot get mount info for %s!\n", dev); - RETURN(-EFAULT); + CERROR("Cannot get mount info for %s! " + "set mdt_opts by default!\n", dev); + } else { + lsi = s2lsi(lmi->lmi_sb); + fsoptions_to_mdt_flags(m, lsi->lsi_lmd->lmd_opts); + server_put_mount_2(dev, lmi->lmi_mnt); } - lsi = s2lsi(lmi->lmi_sb); - fsoptions_to_mdt_flags(m, lsi->lsi_lmd->lmd_opts); - server_put_mount(dev, lmi->lmi_mnt); - spin_lock_init(&m->mdt_ioepoch_lock); m->mdt_opts.mo_compat_resname = 0; m->mdt_capa_timeout = 320; // CAPA_TIMEOUT; diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 8fd5f84..d4f8781 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -158,6 +158,25 @@ struct lustre_mount_info *server_get_mount(const char *name) RETURN(lmi); } +/* + * Used by mdt to get mount_info from obdname. + * There are no blocking when using the mount_info. + * Do not use server_get_mount for this purpose. + */ +struct lustre_mount_info *server_get_mount_2(const char *name) +{ + struct lustre_mount_info *lmi; + ENTRY; + + down(&lustre_mount_info_lock); + lmi = server_find_mount(name); + up(&lustre_mount_info_lock); + if (!lmi) + CERROR("Can't find mount for %s\n", name); + + RETURN(lmi); +} + static void unlock_mntput(struct vfsmount *mnt) { if (kernel_locked()) { @@ -201,14 +220,20 @@ int server_put_mount(const char *name, struct vfsmount *mnt) if (atomic_read(&lmi->lmi_mnt->mnt_count) > 1) CERROR("%s: mount busy, vfscount=%d!\n", name, atomic_read(&lmi->lmi_mnt->mnt_count)); - - /* this obd should never need the mount again */ - server_deregister_mount(name); } + /* this obd should never need the mount again */ + server_deregister_mount(name); + RETURN(0); } +/* Corresponding to server_get_mount_2 */ +int server_put_mount_2(const char *name, struct vfsmount *mnt) +{ + ENTRY; + RETURN(0); +} /******* mount helper utilities *********/ @@ -2112,7 +2137,9 @@ EXPORT_SYMBOL(lustre_common_put_super); EXPORT_SYMBOL(lustre_process_log); EXPORT_SYMBOL(lustre_end_log); EXPORT_SYMBOL(server_get_mount); +EXPORT_SYMBOL(server_get_mount_2); EXPORT_SYMBOL(server_put_mount); +EXPORT_SYMBOL(server_put_mount_2); EXPORT_SYMBOL(server_register_target); EXPORT_SYMBOL(server_name2index); EXPORT_SYMBOL(server_mti_print); -- 1.8.3.1