Whamcloud - gitweb
LU-14090 mgs: no local logs flag
[fs/lustre-release.git] / lustre / obdclass / obd_mount_server.c
index d3ec2f8..374ec8b 100644 (file)
@@ -140,6 +140,7 @@ static int server_deregister_mount(const char *name)
        OBD_FREE(lmi, sizeof(*lmi));
        mutex_unlock(&lustre_mount_info_lock);
 
+       OBD_RACE(OBD_FAIL_MDS_LLOG_UMOUNT_RACE);
        RETURN(0);
 }
 
@@ -476,8 +477,7 @@ void lustre_deregister_lwp_item(struct obd_export **exp)
                CDEBUG(D_MOUNT, "lri reference count %u, repeat: %d\n",
                       atomic_read(&lri->lri_ref), repeat);
                repeat++;
-               set_current_state(TASK_INTERRUPTIBLE);
-               schedule_timeout(cfs_time_seconds(1));
+               schedule_timeout_interruptible(cfs_time_seconds(1));
        }
        lustre_put_lwp_item(lri);
 }
@@ -1161,7 +1161,7 @@ static int server_lsi2mti(struct lustre_sb_info *lsi,
 
        mti->mti_nid_count = 0;
        while (LNetGetId(i++, &id) != -ENOENT) {
-               if (LNET_NETTYP(LNET_NIDNET(id.nid)) == LOLND)
+               if (id.nid == LNET_NID_LO_0)
                        continue;
 
                /* server use --servicenode param, only allow specified
@@ -1265,9 +1265,8 @@ again:
                        if ((rc == -ESHUTDOWN || rc == -EIO) && ++tried < 5) {
                                /* The connection with MGS is not established.
                                 * Try again after 2 seconds. Interruptable. */
-                               set_current_state(TASK_INTERRUPTIBLE);
-                               schedule_timeout(cfs_time_seconds(2));
-                               set_current_state(TASK_RUNNING);
+                               schedule_timeout_interruptible(
+                                       cfs_time_seconds(2));
                                if (!signal_pending(current))
                                        goto again;
                        }
@@ -1472,10 +1471,15 @@ static int server_start_targets(struct super_block *sb)
 
        /* abort recovery only on the complete stack:
         * many devices can be involved */
-       if ((lsi->lsi_lmd->lmd_flags & LMD_FLG_ABORT_RECOV) &&
+       if ((lsi->lsi_lmd->lmd_flags &
+            (LMD_FLG_ABORT_RECOV | LMD_FLG_ABORT_RECOV_MDT)) &&
            (OBP(obd, iocontrol))) {
+               struct obd_ioctl_data karg = {
+                       .ioc_type = lsi->lsi_lmd->lmd_flags,
+               };
+
                obd_iocontrol(OBD_IOC_ABORT_RECOVERY, obd->obd_self_export, 0,
-                             NULL, NULL);
+                             &karg, NULL);
        }
 
 out_mgc:
@@ -1549,6 +1553,8 @@ static int lsi_prepare(struct lustre_sb_info *lsi)
         */
        lsi->lsi_flags |= (lsi->lsi_lmd->lmd_flags & LMD_FLG_WRITECONF) ?
                LDD_F_WRITECONF : 0;
+       lsi->lsi_flags |= (lsi->lsi_lmd->lmd_flags & LMD_FLG_NO_LOCAL_LOGS) ?
+               LDD_F_NO_LOCAL_LOGS : 0;
        lsi->lsi_flags |= (lsi->lsi_lmd->lmd_flags & LMD_FLG_VIRGIN) ?
                LDD_F_VIRGIN : 0;
        lsi->lsi_flags |= (lsi->lsi_lmd->lmd_flags & LMD_FLG_UPDATE) ?
@@ -1725,23 +1731,13 @@ static int server_statfs(struct dentry *dentry, struct kstatfs *buf)
        RETURN(0);
 }
 
-#ifdef HAVE_SUPEROPS_USE_DENTRY
 int server_show_options(struct seq_file *seq, struct dentry *dentry)
-#else
-int server_show_options(struct seq_file *seq, struct vfsmount *vfs)
-#endif
 {
        struct lustre_sb_info *lsi;
        struct lustre_mount_data *lmd;
 
-#ifdef HAVE_SUPEROPS_USE_DENTRY
        LASSERT(seq != NULL && dentry != NULL);
        lsi = s2lsi(dentry->d_sb);
-#else
-       LASSERT(seq != NULL && vfs != NULL);
-       lsi = s2lsi(vfs->mnt_sb);
-#endif
-
        lmd = lsi->lsi_lmd;
        seq_printf(seq, ",svname=%s", lmd->lmd_profile);
 
@@ -1785,7 +1781,7 @@ int server_show_options(struct seq_file *seq, struct vfsmount *vfs)
 /** The operations we support directly on the superblock:
  * mount, umount, and df.
  */
-static struct super_operations server_ops = {
+static const struct super_operations server_ops = {
        .put_super      = server_put_super,
        .umount_begin   = server_umount_begin, /* umount -f */
        .statfs         = server_statfs,
@@ -2054,6 +2050,7 @@ out_mnt:
        server_put_super(sb);
        return rc;
 }
+EXPORT_SYMBOL(server_fill_super);
 
 /*
  * Calculate timeout value for a target.