summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/src/glfs-fops.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index 0e4acb76..605913ae 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -388,8 +388,12 @@ retry:
goto out;
}
- ret = syncop_create (subvol, &loc, flags, mode, glfd->fd,
- xattr_req, &iatt);
+ if (ret == 0) {
+ ret = syncop_open (subvol, &loc, flags, glfd->fd);
+ } else {
+ ret = syncop_create (subvol, &loc, flags, mode, glfd->fd,
+ xattr_req, &iatt);
+ }
ESTALE_RETRY (ret, errno, reval, &loc, retry);
@@ -404,7 +408,7 @@ out:
if (ret && glfd) {
glfs_fd_destroy (glfd);
glfd = NULL;
- } else {
+ } else if (glfd) {
fd_bind (glfd->fd);
glfs_fd_bind (glfd);
}