From 67a6f402d4a4af2e7d9b8d80b25c94f1a08ef029 Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Fri, 6 Jun 2014 12:51:57 +0530 Subject: libgfapi : glfs_create()/glfs_h_creat()/glfs_open()/glfs_h_open() should set fd->flags before syncop_open() glfs_create() and glfs_open() do not set fd->flags before calling syncop_open(). This patch addresses this problem and ensure the flags are set in fd before invoking syncop_open() Change-Id: I9ef3243b1de610e1dd1a3e37b66fc2f763a865f9 BUG: 1096047 Signed-off-by: Atin Mukherjee Reviewed-on: http://review.gluster.org/7999 Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi Reviewed-by: Humble Devassy Chirammal Reviewed-by: Anand Avati --- api/src/glfs-handleops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'api/src/glfs-handleops.c') diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c index ba468382077..0188128f712 100644 --- a/api/src/glfs-handleops.c +++ b/api/src/glfs-handleops.c @@ -500,6 +500,7 @@ glfs_h_open (struct glfs *fs, struct glfs_object *object, int flags) errno = ENOMEM; goto out; } + glfd->fd->flags = flags; /* populate loc */ GLFS_LOC_FILL_INODE (inode, loc, out); @@ -518,7 +519,6 @@ out: glfs_fd_destroy (glfd); glfd = NULL; } else { - glfd->fd->flags = flags; fd_bind (glfd->fd); glfs_fd_bind (glfd); } @@ -592,6 +592,7 @@ glfs_h_creat (struct glfs *fs, struct glfs_object *parent, const char *path, errno = ENOMEM; goto out; } + glfd->fd->flags = flags; /* fop/op */ ret = syncop_create (subvol, &loc, flags, mode, glfd->fd, -- cgit