From: Ben Gras Date: Mon, 13 May 2013 19:06:12 +0000 (+0000) Subject: vfs: who_p fix X-Git-Tag: v3.3.0~948 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/static/named-checkconf.html?a=commitdiff_plain;h=5507a12d7c81678d72a45169c7cfeab70f8d0c50;p=minix.git vfs: who_p fix Change-Id: I0e04b6460907f5e67f6c90b2038d296d66b9a414 --- diff --git a/servers/vfs/main.c b/servers/vfs/main.c index d18cb752f..0bf2624f3 100644 --- a/servers/vfs/main.c +++ b/servers/vfs/main.c @@ -761,14 +761,15 @@ static void get_work() if (proc_p < 0 || proc_p >= NR_PROCS) fp = NULL; else fp = &fproc[proc_p]; - if (m_in.m_type == EDEADSRCDST) return; /* Failed 'sendrec' */ + if (m_in.m_type == EDEADSRCDST) { + printf("VFS: failed sendrec\n"); + return; /* Failed 'sendrec' */ + } /* Negative who_p is never used to access the fproc array. Negative * numbers (kernel tasks) are treated in a special way. */ - if (who_p >= (int)(sizeof(fproc) / sizeof(struct fproc))) - panic("receive process out of range: %d", who_p); - if (who_p >= 0 && fproc[who_p].fp_endpoint == NONE) { + if (fp && fp->fp_endpoint == NONE) { printf("VFS: ignoring request from %d: NONE endpoint %d (%d)\n", m_in.m_source, who_p, m_in.m_type); continue; @@ -777,14 +778,13 @@ static void get_work() /* Internal consistency check; our mental image of process numbers and * endpoints must match with how the rest of the system thinks of them. */ - if (who_p >= 0 && fproc[who_p].fp_endpoint != who_e) { + if (fp && fp->fp_endpoint != who_e) { if (fproc[who_p].fp_endpoint == NONE) printf("slot unknown even\n"); - printf("VFS: receive endpoint inconsistent (source %d, who_p " + panic("VFS: receive endpoint inconsistent (source %d, who_p " "%d, stored ep %d, who_e %d).\n", m_in.m_source, who_p, fproc[who_p].fp_endpoint, who_e); - panic("VFS: inconsistent endpoint "); } return;