symlink: on open for mklink, only check for FILE_EXISTS
avoid calling map_disposition_2_nfsopen() for this, because FILE_CREATE->ERROR_FILE_EXISTS is the only case we care about Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
parent
870b389e8f
commit
64480d0aca
1 changed files with 5 additions and 4 deletions
|
|
@ -327,11 +327,10 @@ int handle_open(nfs41_upcall *upcall)
|
||||||
args->access_mode == 0 &&
|
args->access_mode == 0 &&
|
||||||
args->create_opts & FILE_OPEN_REPARSE_POINT) {
|
args->create_opts & FILE_OPEN_REPARSE_POINT) {
|
||||||
/* fail if the file already exists */
|
/* fail if the file already exists */
|
||||||
uint32_t create;
|
if (status == NO_ERROR) {
|
||||||
status = map_disposition_2_nfsopen(args->disposition, status,
|
status = ERROR_FILE_EXISTS;
|
||||||
&create, &upcall->last_error);
|
|
||||||
if (status)
|
|
||||||
goto out_free_state;
|
goto out_free_state;
|
||||||
|
}
|
||||||
|
|
||||||
/* defer the call to CREATE until we get the symlink set upcall */
|
/* defer the call to CREATE until we get the symlink set upcall */
|
||||||
dprintf(1, "trying to create a symlink, deferring create\n");
|
dprintf(1, "trying to create a symlink, deferring create\n");
|
||||||
|
|
@ -339,6 +338,8 @@ int handle_open(nfs41_upcall *upcall)
|
||||||
/* because of WRITE_ATTR access, be prepared for a setattr upcall;
|
/* because of WRITE_ATTR access, be prepared for a setattr upcall;
|
||||||
* will crash if the superblock is null, so use the parent's */
|
* will crash if the superblock is null, so use the parent's */
|
||||||
state->file.fh.superblock = state->parent.fh.superblock;
|
state->file.fh.superblock = state->parent.fh.superblock;
|
||||||
|
|
||||||
|
status = NO_ERROR;
|
||||||
} else if (do_lookup(state->type, args->access_mask, args->disposition)) {
|
} else if (do_lookup(state->type, args->access_mask, args->disposition)) {
|
||||||
if (status) {
|
if (status) {
|
||||||
dprintf(1, "nfs41_lookup failed with %d\n", status);
|
dprintf(1, "nfs41_lookup failed with %d\n", status);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue