From e2a5ff182c8cebfd3175444c7720a6a2653a0f03 Mon Sep 17 00:00:00 2001 From: nikita Date: Fri, 3 Nov 2006 18:28:32 +0000 Subject: [PATCH] seq: fix (paper over, in fact) NULL pointer dereference during read of /proc/fs/lustre/seq/cli-ctl-* files. --- lustre/fid/lproc_fid.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lustre/fid/lproc_fid.c b/lustre/fid/lproc_fid.c index 14323a7..2700c50 100644 --- a/lustre/fid/lproc_fid.c +++ b/lustre/fid/lproc_fid.c @@ -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); } -- 1.8.3.1