We may take the O_CREAT path and get an fh from _create, but created can
still be false. In that case, skip the final _open call.
Signed-off-by: Sage Weil <sage@inktank.com>
tout(cct) << mode << std::endl;
tout(cct) << flags << std::endl;
+ *fhp = NULL;
+
bool created = false;
Inode *in = NULL;
Inode *dir = _ll_get_inode(parent);
if (r < 0)
goto out;
- r = _open(in, flags, mode, fhp);
- if (r < 0)
- goto out;
+ if (*fhp == NULL) {
+ r = _open(in, flags, mode, fhp);
+ if (r < 0)
+ goto out;
+ }
}
out: