symlink: handle errors from REMOVE
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
parent
829c05d6b5
commit
e83d36544f
2 changed files with 11 additions and 1 deletions
|
|
@ -214,6 +214,8 @@ static int map_symlink_errors(int status)
|
|||
case NFS4ERR_BADCHAR:
|
||||
case NFS4ERR_BADNAME: return ERROR_INVALID_REPARSE_DATA;
|
||||
case NFS4ERR_WRONG_TYPE: return ERROR_NOT_A_REPARSE_POINT;
|
||||
case NFS4ERR_ACCESS: return ERROR_ACCESS_DENIED;
|
||||
case NFS4ERR_NOTEMPTY: return ERROR_NOT_EMPTY;
|
||||
default: return nfs_to_windows_error(status, ERROR_BAD_NET_RESP);
|
||||
}
|
||||
}
|
||||
|
|
@ -236,8 +238,14 @@ static int handle_symlink(nfs41_upcall *upcall)
|
|||
eprintf("handle_symlink: attempting to create a symlink when "
|
||||
"the file=%s was already created on open; sending REMOVE "
|
||||
"first\n", state->file.path->path);
|
||||
nfs41_remove(state->session, &state->parent,
|
||||
status = nfs41_remove(state->session, &state->parent,
|
||||
&state->file.name, state->file.fh.fileid);
|
||||
if (status) {
|
||||
eprintf("nfs41_remove() for symlink=%s failed with %s\n",
|
||||
args->target_set, nfs_error_string(status));
|
||||
status = map_symlink_errors(status);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
/* create the symlink */
|
||||
|
|
|
|||
|
|
@ -5838,6 +5838,8 @@ NTSTATUS map_symlink_errors(
|
|||
case NO_ERROR: return STATUS_SUCCESS;
|
||||
case ERROR_INVALID_REPARSE_DATA: return STATUS_IO_REPARSE_DATA_INVALID;
|
||||
case ERROR_NOT_A_REPARSE_POINT: return STATUS_NOT_A_REPARSE_POINT;
|
||||
case ERROR_ACCESS_DENIED: return STATUS_ACCESS_DENIED;
|
||||
case ERROR_NOT_EMPTY: return STATUS_DIRECTORY_NOT_EMPTY;
|
||||
case ERROR_OUTOFMEMORY: return STATUS_INSUFFICIENT_RESOURCES;
|
||||
case ERROR_INSUFFICIENT_BUFFER: return STATUS_BUFFER_TOO_SMALL;
|
||||
case STATUS_BUFFER_TOO_SMALL:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue