int Client::_open(Inode *in, int flags, mode_t mode, Fh **fhp, int uid, int gid)
{
int cmode = ceph_flags_to_mode(flags);
+ if (cmode < 0)
+ return -EINVAL;
int want = ceph_caps_for_mode(cmode);
int result = 0;
if (dir->snapid != CEPH_NOSNAP) {
return -EROFS;
}
+
+ int cmode = ceph_flags_to_mode(flags);
+ if (cmode < 0)
+ return -EINVAL;
MetaRequest *req = new MetaRequest(CEPH_MDS_OP_CREATE);
if (res >= 0) {
res = _lookup(dir, name, inp);
if (res >= 0) {
- int cmode = ceph_flags_to_mode(flags);
(*inp)->get_open_ref(cmode);
*fhp = _create_fh(*inp, flags, cmode);
}