/* Fetch the stack from the user before destroying the old core image. */
if (frame_len > ARG_MAX)
{
- printf("pm_exec: bad frame_len\n");
-printf("return at %s, %d\n", __FILE__, __LINE__);
return(ENOMEM); /* stack too big */
}
r = sys_datacopy(proc_e, (vir_bytes) frame,
progname, new_uid, new_gid, &stack_top, &load_text, &allow_setuid);
if (r != OK)
{
- printf("pm_exec: exec_newmap failed: %d\n", r);
+ printf("VFS: pm_exec: exec_newmem failed: %d\n", r);
put_vnode(vp);
return r;
}
proc_e, (vir_bytes) vsp, (phys_bytes)frame_len);
if (r != OK) {
printf("vfs: datacopy returns %d trying to copy to %p\n", r, vsp);
- panic(__FILE__,"pm_exec stack copy err on", proc_e);
+ return r;
}
off = hdrlen;
char buf[1024];
/* Make sure that the file is big enough */
- if (vp->v_size < off+seg_bytes) return EIO;
+ if (vp->v_size < off+seg_bytes) {
+ printf("VFS: read_seg: file isn't big enough (size %ld, need %ld)\n",
+ vp->v_size, off+seg_bytes);
+ return EIO;
+ }
if (seg != D)
{
r = req_readwrite(vp->v_fs_e, vp->v_inode_nr, vp->v_index,
cvul64(off+o), READING, FS_PROC_NR, buf, n, &new_pos,
&cum_io_incr);
- if (r != OK) return r;
+ if (r != OK) {
+ printf("VFS: read_seg: req_readwrite failed (text)\n");
+ return r;
+ }
if (cum_io_incr != n)
{
r= sys_vircopy(FS_PROC_NR, D, (vir_bytes)buf, proc_e, seg, o,
n);
- if (r != OK)
+ if (r != OK) {
+ printf("VFS: read_seg: copy failed (text)\n");
return r;
+ }
o += n;
}
/* Issue request */
r = req_readwrite(vp->v_fs_e, vp->v_inode_nr, vp->v_index, cvul64(off),
READING, proc_e, 0, seg_bytes, &new_pos, &cum_io_incr);
- if (r != OK) return r;
+ if (r != OK) {
+ printf("VFS: read_seg: req_readwrite failed (data)\n");
+ return r;
+ }
if (r == OK && cum_io_incr != seg_bytes)
printf("VFSread_seg segment has not been read properly by exec() \n");
#include <minix/const.h>
#include <minix/endpoint.h>
#include <minix/safecopies.h>
+#include <minix/debug.h>
#include "file.h"
#include "fproc.h"
#include "param.h"
SANITYCHECK;
+#if DO_SANITYCHECKS
+ FIXME("VFS: DO_SANITYCHECKS is on");
+#endif
+
/* This is the main loop that gets work, processes it, and sends replies. */
while (TRUE) {
SANITYCHECK;
continue;
}
if(who_p >= 0 && fproc[who_p].fp_endpoint != who_e) {
- printf("FS: receive endpoint inconsistent (%d, %d, %d).\n",
- who_e, fproc[who_p].fp_endpoint, who_e);
+ if(fproc[who_p].fp_endpoint == NONE) {
+ printf("slot unknown even\n");
+ }
+ printf("FS: 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);
+#if 0
panic(__FILE__, "FS: inconsistent endpoint ", NO_NUM);
+#endif
continue;
}
call_nr = m_in.m_type;
struct vnode *dir_vp;
struct vmnt *vmp;
struct lookup_res res;
-
+
/* Empty (start) path? */
if (user_fullpath[0] == '\0') {
node->inode_nr = 0;
dir_vp = 0;
/* Start node is now the mounted partition's root node */
for (vmp = &vmnt[0]; vmp != &vmnt[NR_MNTS]; ++vmp) {
- if (vmp->m_mounted_on->v_inode_nr == res.inode_nr &&
- vmp->m_mounted_on->v_fs_e == res.fs_e) {
+ if (vmp->m_dev != NO_DEV) {
+ if(vmp->m_mounted_on &&
+ vmp->m_mounted_on->v_inode_nr ==
+ res.inode_nr &&
+ vmp->m_mounted_on->v_fs_e == res.fs_e) {
dir_vp = vmp->m_root_node;
+ if(!dir_vp) {
+ panic(__FILE__,
+ "vfs: root_node NULL", NO_NUM);
+ }
break;
+ }
}
}
if (!dir_vp) {