upcall: set upcall.status on parse failure

when open parsing fails, we were still returning upcall.status==NO_ERROR, so the driver assumed the open succeeded.  other operations then sent up an open_state==NULL, and crashed the daemon.  when upcall_parse() returns an error, set upcall.status to notify the driver

upcall_parse() prints a 'parsing of upcall <name> failed with <error>.' message on failure, so i removed redundant messages from the individual upcall parsing functions

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2010-10-12 10:03:03 -04:00
parent a0cda354be
commit 95361423f3
9 changed files with 68 additions and 84 deletions

View file

@ -39,12 +39,11 @@ int parse_mount(unsigned char *buffer, uint32_t length, nfs41_upcall *upcall)
if(status) goto out;
ZeroMemory(&args->path, sizeof(nfs41_abs_path));
status = get_abs_path(&buffer, &length, &args->path);
if(status) goto out;
dprintf(1, "parsing NFS14_MOUNT: srv_name=%s root=%s\n",
args->srv_name, args->path.path);
out:
if (status)
eprintf("parsing of NFS41_MOUNT failed with %d\n", status);
else
dprintf(1, "parsing NFS14_MOUNT: srv_name=%s root=%s\n",
args->srv_name, args->path.path);
return status;
}
@ -110,10 +109,10 @@ int parse_unmount(unsigned char *buffer, uint32_t length, nfs41_upcall *upcall)
unmount_upcall_args *args = &upcall->args.unmount;
status = safe_read(&buffer, &length, &args->root, sizeof(nfs41_session *));
if (status)
eprintf("parsing NFS41_UNMOUNT failed with %d\n", status);
else
dprintf(1, "parsing NFS41_UNMOUNT: unmount root=%p\n", args->root);
if (status) goto out;
dprintf(1, "parsing NFS41_UNMOUNT: unmount root=%p\n", args->root);
out:
return status;
}