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:
parent
a0cda354be
commit
95361423f3
9 changed files with 68 additions and 84 deletions
|
|
@ -61,15 +61,14 @@ int parse_setattr(unsigned char *buffer, uint32_t length, nfs41_upcall *upcall)
|
|||
status = safe_read(&buffer, &length, &args->access_mask, sizeof(ULONG));
|
||||
if (status) goto out_free;
|
||||
status = safe_read(&buffer, &length, &args->access_mode, sizeof(ULONG));
|
||||
if (status) goto out_free;
|
||||
|
||||
dprintf(1, "parsing NFS41_FILE_SET: filename='%s' info_class=%d "
|
||||
"buf_len=%d root=%p open_state=%p\nopen_owner_id=%d "
|
||||
"access_mask=%x access_mode=%x\n", args->path.path, args->set_class,
|
||||
args->buf_len, args->root, args->state, args->open_owner_id,
|
||||
args->access_mask, args->access_mode);
|
||||
out:
|
||||
if (status)
|
||||
eprintf("parsing NFS41_FILE_SET failed with %d\n", status);
|
||||
else
|
||||
dprintf(1, "parsing NFS41_FILE_SET: filename='%s' info_class=%d "
|
||||
"buf_len=%d root=%p open_state=%p\nopen_owner_id=%d "
|
||||
"access_mask=%x access_mode=%x\n", args->path.path, args->set_class,
|
||||
args->buf_len, args->root, args->state, args->open_owner_id,
|
||||
args->access_mask, args->access_mode);
|
||||
return status;
|
||||
out_free:
|
||||
free(args->buf);
|
||||
|
|
@ -464,12 +463,11 @@ int parse_setexattr(unsigned char *buffer, uint32_t length, nfs41_upcall *upcall
|
|||
status = safe_read(&buffer, &length, &args->state, sizeof(args->state));
|
||||
if (status) goto out;
|
||||
status = safe_read(&buffer, &length, &args->mode, sizeof(args->mode));
|
||||
if (status) goto out;
|
||||
|
||||
dprintf(1, "parsing NFS41_EA_SET: root=%p open_state=%p mode=%o\n",
|
||||
args->root, args->state, args->mode);
|
||||
out:
|
||||
if (status)
|
||||
eprintf("parsing NFS41_EA_SET failed with %d\n", status);
|
||||
else
|
||||
dprintf(1, "parsing NFS41_EA_SET: root=%p open_state=%p mode=%o\n",
|
||||
args->root, args->state, args->mode);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue