This is to deal with the slightly perverse situation
where a user might have all the permissions they need
to create a filesystem and mount it with fuse, but then
be unable to do anything inside the mount because
we default to creating a root-owned "/" inode.
This is immediatley useful for dev/test environments without
root, but also potentially in production environments
where the filesystem configuration/mounting is done by
someone less privileged than root.
Signed-off-by: John Spray <john.spray@redhat.com>
// Maximum number of concurrent RADOS ops to issue in purging, scaled by PG count
OPTION(mds_max_purge_ops_per_pg, OPT_FLOAT, 0.5)
+OPTION(mds_root_ino_uid, OPT_INT, 0) // The UID of / on new filesystems
+OPTION(mds_root_ino_gid, OPT_INT, 0) // The GID of / on new filesystems
+
// If true, compact leveldb store on mount
OPTION(osd_compact_leveldb_on_mount, OPT_BOOL, false)
CInode *MDCache::create_root_inode()
{
CInode *i = create_system_inode(MDS_INO_ROOT, S_IFDIR|0755);
+ i->inode.uid = g_conf->mds_root_ino_uid;
+ i->inode.gid = g_conf->mds_root_ino_gid;
i->inode.layout = default_file_layout;
i->inode.layout.fl_pg_pool = mds->mdsmap->get_first_data_pool();
return i;