__u32 mask = req->head.args.setattr.mask;
__u32 access_mask = MAY_WRITE;
+ // No changes to encrypted inodes from legacy clients
+ if (!cur->get_inode()->fscrypt_file.empty() && req->get_header().version < 6) {
+ respond_to_request(mdr, -CEPHFS_EPERM);
+ return;
+ }
+
// xlock inode
if (mask & (CEPH_SETATTR_MODE|CEPH_SETATTR_UID|CEPH_SETATTR_GID|CEPH_SETATTR_BTIME|CEPH_SETATTR_KILL_SGUID))
lov.add_xlock(&cur->authlock);
pi.inode->size = req->head.args.setattr.size;
pi.inode->rstat.rbytes = pi.inode->size;
}
+ if (req->get_header().version >= 6) {
+ pi.inode->fscrypt_file = req->fscrypt_file;
+ }
+
pi.inode->mtime = mdr->get_op_stamp();
// adjust client's max_size?
class MClientRequest final : public MMDSOp {
private:
- static constexpr int HEAD_VERSION = 5;
+ static constexpr int HEAD_VERSION = 6;
static constexpr int COMPAT_VERSION = 1;
public:
std::string alternate_name;
std::vector<uint64_t> gid_list;
+ std::vector<uint8_t> fscrypt_auth;
+ std::vector<uint8_t> fscrypt_file;
+
/* XXX HACK */
mutable bool queued_for_replay = false;
decode(gid_list, p);
if (header.version >= 5)
decode(alternate_name, p);
+ if (header.version >= 6) {
+ decode(fscrypt_auth, p);
+ decode(fscrypt_file, p);
+ }
}
void encode_payload(uint64_t features) override {
encode(stamp, payload);
encode(gid_list, payload);
encode(alternate_name, payload);
+ encode(fscrypt_auth, payload);
+ encode(fscrypt_file, payload);
}
std::string_view get_type_name() const override { return "creq"; }