From 64480d0aca95bf1b65d91a0847e6b3f1a34f7627 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 15 Oct 2010 16:15:42 -0400 Subject: [PATCH] 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 --- daemon/open.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/daemon/open.c b/daemon/open.c index 51174c4..fe81639 100644 --- a/daemon/open.c +++ b/daemon/open.c @@ -327,11 +327,10 @@ int handle_open(nfs41_upcall *upcall) args->access_mode == 0 && args->create_opts & FILE_OPEN_REPARSE_POINT) { /* fail if the file already exists */ - uint32_t create; - status = map_disposition_2_nfsopen(args->disposition, status, - &create, &upcall->last_error); - if (status) + if (status == NO_ERROR) { + status = ERROR_FILE_EXISTS; goto out_free_state; + } /* defer the call to CREATE until we get the symlink set upcall */ 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; * will crash if the superblock is null, so use the parent's */ state->file.fh.superblock = state->parent.fh.superblock; + + status = NO_ERROR; } else if (do_lookup(state->type, args->access_mask, args->disposition)) { if (status) { dprintf(1, "nfs41_lookup failed with %d\n", status);