Whamcloud - gitweb
seq: fix (paper over, in fact) NULL pointer dereference during read of /proc/fs/lustr...
authornikita <nikita>
Fri, 3 Nov 2006 18:28:32 +0000 (18:28 +0000)
committernikita <nikita>
Fri, 3 Nov 2006 18:28:32 +0000 (18:28 +0000)
lustre/fid/lproc_fid.c

index 14323a7..2700c50 100644 (file)
@@ -310,13 +310,20 @@ seq_client_proc_read_server(char *page, char **start, off_t off,
                             int count, int *eof, void *data)
 {
         struct lu_client_seq *seq = (struct lu_client_seq *)data;
-        struct client_obd *cli = &seq->lcs_exp->exp_obd->u.cli;
+        struct client_obd *cli;
        int rc;
        ENTRY;
 
         LASSERT(seq != NULL);
-        rc = snprintf(page, count, "%s\n",
-                      cli->cl_target_uuid.uuid);
+
+        if (seq->lcs_exp != NULL) {
+                cli = &seq->lcs_exp->exp_obd->u.cli;
+                rc = snprintf(page, count, "%s\n", cli->cl_target_uuid.uuid);
+        } else
+                /*
+                 * Export-less sequence, see mdt_seq_init().
+                 */
+                rc = snprintf(page, count, "none\n");
        RETURN(rc);
 }