From: John Spray Date: Tue, 28 Jul 2015 10:13:21 +0000 (+0100) Subject: mds: configurable uid/gid on new root inos X-Git-Tag: v9.1.0~456^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4e42414021fc0926390c3b3714f4f3f7fab3027a;p=ceph.git mds: configurable uid/gid on new root inos 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 --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index d41e44df67f1..b21f69a788ba 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -487,6 +487,9 @@ OPTION(mds_max_purge_ops, OPT_U32, 8192) // 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) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 1cf5161aa0bb..3b55e778e825 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -399,6 +399,8 @@ CInode *MDCache::create_system_inode(inodeno_t ino, int mode) 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;