Skip to content

Commit

Permalink
Merge pull request #11789 from jcsp/wip-17798
Browse files Browse the repository at this point in the history
mds: require MAY_SET_POOL to set pool_ns

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
  • Loading branch information
John Spray committed Nov 11, 2016
2 parents 36905d7 + 1dfee37 commit d5bea25
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mds/Server.cc
Expand Up @@ -3183,9 +3183,8 @@ void Server::handle_client_openc(MDRequestRef& mdr)
// file would have inherited anyway from its parent.
CDir *parent = dn->get_dir();
CInode *parent_in = parent->get_inode();
int64_t parent_pool = parent_in->inode.layout.pool_id;

if (layout.pool_id != parent_pool) {
if (layout.pool_id != parent_in->inode.layout.pool_id
|| layout.pool_ns != parent_in->inode.layout.pool_ns) {
access |= MAY_SET_POOL;
}

Expand Down Expand Up @@ -4323,7 +4322,8 @@ void Server::handle_set_vxattr(MDRequestRef& mdr, CInode *cur,
if (!mds->locker->acquire_locks(mdr, rdlocks, wrlocks, xlocks))
return;

if (cur->inode.layout.pool_id != layout.pool_id) {
if (cur->inode.layout.pool_id != layout.pool_id
|| cur->inode.layout.pool_ns != layout.pool_ns) {
if (!check_access(mdr, cur, MAY_SET_POOL)) {
return;
}
Expand Down

0 comments on commit d5bea25

Please sign in to comment.