{
int r = 0;
Dentry *dn = NULL;
+ // can only request shared caps
+ mask &= CEPH_CAP_ANY_SHARED;
if (dname == "..") {
if (dir->dentries.empty()) {
mode_t mode, int stripe_unit, int stripe_count,
int object_size, const char *data_pool)
{
- ldout(cct, 3) << "open enter(" << relpath << ", " << ceph_flags_sys2wire(flags) << "," << mode << ")" << dendl;
+ int cflags = ceph_flags_sys2wire(flags);
+
+ ldout(cct, 3) << "open enter(" << relpath << ", " << cflags << "," << mode << ")" << dendl;
std::lock_guard lock(client_lock);
tout(cct) << "open" << std::endl;
tout(cct) << relpath << std::endl;
- tout(cct) << ceph_flags_sys2wire(flags) << std::endl;
+ tout(cct) << cflags << std::endl;
if (unmounting)
return -ENOTCONN;
bool created = false;
/* O_CREATE with O_EXCL enforces O_NOFOLLOW. */
bool followsym = !((flags & O_NOFOLLOW) || ((flags & O_CREAT) && (flags & O_EXCL)));
- int r = path_walk(path, &in, perms, followsym, ceph_caps_for_mode(mode));
+ int mask = ceph_caps_for_mode(ceph_flags_to_mode(cflags));
+
+ int r = path_walk(path, &in, perms, followsym, mask);
if (r == 0 && (flags & O_CREAT) && (flags & O_EXCL))
return -EEXIST;
out:
tout(cct) << r << std::endl;
- ldout(cct, 3) << "open exit(" << path << ", " << ceph_flags_sys2wire(flags) << ") = " << r << dendl;
+ ldout(cct, 3) << "open exit(" << path << ", " << cflags << ") = " << r << dendl;
return r;
}