This new configuration option will allow to define the maximum size for a
filesystem xattrs blob. This is a filesystem-wide knob that will replace
the per-MDS mds_max_xattr_pairs_size option.
Note:
The kernel client patch to handle this new configuration was merged before
the corresponding ceph-side pull-request. This was unfortunate because in
the meantime PR #43284 was merged and the encoding/decoding of
'bal_rank_mask' got in between. Hence the 'max_xattr_size' is being
encoding/decoded before 'bal_rank_mask'.
URL: https://tracker.ceph.com/issues/55725
Signed-off-by: Luís Henriques <lhenriques@suse.de>
(cherry picked from commit
7b8def5c30b92ec642209f6ab1af312e49343c01)
cephfs_dump_features(f, required_client_features);
f->close_section();
f->dump_int("max_file_size", max_file_size);
+ f->dump_int("max_xattr_size", max_xattr_size);
f->dump_int("last_failure", last_failure);
f->dump_int("last_failure_osd_epoch", last_failure_osd_epoch);
f->open_object_section("compat");
out << "session_timeout\t" << session_timeout << "\n"
<< "session_autoclose\t" << session_autoclose << "\n";
out << "max_file_size\t" << max_file_size << "\n";
+ out << "max_xattr_size\t" << max_xattr_size << "\n";
out << "required_client_features\t" << cephfs_stringify_features(required_client_features) << "\n";
out << "last_failure\t" << last_failure << "\n"
<< "last_failure_osd_epoch\t" << last_failure_osd_epoch << "\n";
encode(min_compat_client, bl);
}
encode(required_client_features, bl);
+ encode(max_xattr_size, bl);
encode(bal_rank_mask, bl);
ENCODE_FINISH(bl);
}
}
if (ev >= 17) {
+ decode(max_xattr_size, p);
decode(bal_rank_mask, p);
}
#define MDS_FS_NAME_DEFAULT "cephfs"
+/*
+ * Maximum size of xattrs the MDS can handle per inode by default. This
+ * includes the attribute name and 4+4 bytes for the key/value sizes.
+ */
+#define MDS_MAX_XATTR_SIZE (1<<16) /* 64K */
+
class health_check_map_t;
class MDSMap {
uint64_t get_max_filesize() const { return max_file_size; }
void set_max_filesize(uint64_t m) { max_file_size = m; }
+ uint64_t get_max_xattr_size() const { return max_xattr_size; }
+ void set_max_xattr_size(uint64_t m) { max_xattr_size = m; }
+
void set_min_compat_client(ceph_release_t version);
void add_required_client_feature(size_t bit) {
__u32 session_autoclose = 300;
uint64_t max_file_size = 1ULL<<40; /* 1TB */
+ uint64_t max_xattr_size = MDS_MAX_XATTR_SIZE;
+
feature_bitset_t required_client_features;
std::vector<int64_t> data_pools; // file data pools available to clients (via an ioctl). first is the default.
{
fs->mds_map.set_max_filesize(n);
});
+ } else if (var == "max_xattr_size") {
+ if (interr.length()) {
+ ss << var << " requires an integer value";
+ return -EINVAL;
+ }
+ fsmap.modify_filesystem(
+ fs->fscid,
+ [n](std::shared_ptr<Filesystem> fs)
+ {
+ fs->mds_map.set_max_xattr_size(n);
+ });
} else if (var == "allow_new_snaps") {
bool enable_snaps = false;
int r = parse_bool(val, &enable_snaps, ss);
"|allow_new_snaps|inline_data|cluster_down|allow_dirfrags|balancer"
"|standby_count_wanted|session_timeout|session_autoclose"
"|allow_standby_replay|down|joinable|min_compat_client|bal_rank_mask"
- "|refuse_client_session "
+ "|refuse_client_session|max_xattr_size "
"name=val,type=CephString "
"name=yes_i_really_mean_it,type=CephBool,req=false "
"name=yes_i_really_really_mean_it,type=CephBool,req=false",