From ed75d6588899b3a812818e82ac7805998dbbd5e0 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 18 Nov 2009 01:20:15 +0000 Subject: libglusterfsclient/open: don't send create call if the file is already present, instead send open. Signed-off-by: Raghavendra G Signed-off-by: Anand V. Avati BUG: 369 (Samba does not work with booster.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=369 --- libglusterfsclient/src/libglusterfsclient.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libglusterfsclient') diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 83943bd2a..93d9e3c2f 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -2949,6 +2949,10 @@ glusterfs_glh_open (glusterfs_handle_t handle, const char *path, int flags,...) goto out; } + if (op_ret == 0) { + flags &= ~O_CREAT; + } + if ((op_ret == -1) && ((flags & O_CREAT) == O_CREAT)) { libgf_client_loc_wipe (&loc); loc.path = strdup (pathres); @@ -2979,7 +2983,7 @@ glusterfs_glh_open (glusterfs_handle_t handle, const char *path, int flags,...) fd = fd_create (loc.inode, ctx->pid); fd->flags = flags; - if ((flags & O_CREAT) == O_CREAT) { + if (((flags & O_CREAT) == O_CREAT)) { /* If we have the st_mode for the basename, check if * it is a directory here itself, rather than sending * a network message through libgf_client_creat, and -- cgit