diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2014-06-06 12:51:57 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2014-07-28 23:35:17 -0700 |
commit | 67a6f402d4a4af2e7d9b8d80b25c94f1a08ef029 (patch) | |
tree | 1b5f398bf404c851a3989295ad64d7438e1e6228 /api/src/glfs-fops.c | |
parent | a95444c95cfde4d80c179f2af2f0334565049a51 (diff) |
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 <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/7999
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'api/src/glfs-fops.c')
-rw-r--r-- | api/src/glfs-fops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index bc9c758a9c9..a5ab8e43961 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -124,6 +124,7 @@ retry: errno = ENOMEM; goto out; } + glfd->fd->flags = flags; ret = syncop_open (subvol, &loc, flags, glfd->fd); DECODE_SYNCOP_ERR (ret); @@ -136,7 +137,6 @@ out: glfs_fd_destroy (glfd); glfd = NULL; } else if (glfd) { - glfd->fd->flags = flags; fd_bind (glfd->fd); glfs_fd_bind (glfd); } @@ -394,6 +394,7 @@ retry: errno = ENOMEM; goto out; } + glfd->fd->flags = flags; if (ret == 0) { ret = syncop_open (subvol, &loc, flags, glfd->fd); @@ -418,7 +419,6 @@ out: glfs_fd_destroy (glfd); glfd = NULL; } else if (glfd) { - glfd->fd->flags = flags; fd_bind (glfd->fd); glfs_fd_bind (glfd); } |