summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/src/glfs-fops.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index dd9ea451a..1794e603f 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -394,8 +394,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);