Whamcloud - gitweb
LU-5496 ldlm: reconstruct proper flags on enqueue resend
[fs/lustre-release.git] / lustre / mgs / mgs_handler.c
index b0c5be7..7e196fb 100644 (file)
@@ -60,6 +60,7 @@ static int mgs_connect(struct tgt_session_info *tsi)
 
        ENTRY;
 
+       CFS_FAIL_TIMEOUT(OBD_FAIL_MGS_CONNECT_NET, cfs_fail_val);
        rc = tgt_connect(tsi);
        if (rc)
                RETURN(rc);
@@ -144,8 +145,7 @@ static int mgs_completion_ast_generic(struct ldlm_lock *lock, __u64 flags,
 {
        ENTRY;
 
-       if (!(flags & (LDLM_FL_BLOCK_WAIT | LDLM_FL_BLOCK_GRANTED |
-                      LDLM_FL_BLOCK_CONV))) {
+       if (!(flags & LDLM_FL_BLOCKED_MASK)) {
                struct fs_db *fsdb;
 
                /* l_ast_data is used as a marker to avoid cancel ldlm lock
@@ -539,11 +539,14 @@ static int mgs_llog_open(struct tgt_session_info *tsi)
        logname = req_capsule_client_get(tsi->tsi_pill, &RMF_NAME);
        if (logname) {
                char *ptr = strchr(logname, '-');
-               int   len = (int)(ptr - logname);
+               int   len = (ptr != NULL) ? (int)(ptr - logname) : 0;
 
                if (ptr == NULL || len >= sizeof(mgi->mgi_fsname)) {
-                       LCONSOLE_WARN("%s: non-config logname received: %s\n",
-                                     tgt_name(tsi->tsi_tgt), logname);
+                       if (strcmp(logname, PARAMS_FILENAME) != 0)
+                               LCONSOLE_WARN("%s: non-config logname "
+                                             "received: %s\n",
+                                             tgt_name(tsi->tsi_tgt),
+                                             logname);
                        /* not error, this can be llog test name */
                } else {
                        strncpy(mgi->mgi_fsname, logname, len);
@@ -574,7 +577,7 @@ static inline int mgs_init_export(struct obd_export *exp)
 
        /* init mgs_export_data for fsc */
        spin_lock_init(&data->med_lock);
-       CFS_INIT_LIST_HEAD(&data->med_clients);
+       INIT_LIST_HEAD(&data->med_clients);
 
        spin_lock(&exp->exp_lock);
        exp->exp_connecting = 1;
@@ -1526,9 +1529,6 @@ static struct obd_ops mgs_obd_device_ops = {
 static int __init mgs_init(void)
 {
        return class_register_type(&mgs_obd_device_ops, NULL, true, NULL,
-#ifndef HAVE_ONLY_PROCFS_SEQ
-                                  NULL,
-#endif
                                   LUSTRE_MGS_NAME, &mgs_device_type);
 }