Skip to content

Commit

Permalink
Merge pull request ceph#46641 from lxbsz/wip-56010
Browse files Browse the repository at this point in the history
mds: switch to use projected inode instead

Reviewed-by: Venky Shankar <[email protected]>
Reviewed-by: Patrick Donnelly <[email protected]>
Reviewed-by: Kotresh HR <[email protected]>
Reviewed-by: Ramana Raja <[email protected]>
Reviewed-by:  Luis Henriques <[email protected]>
  • Loading branch information
vshankar authored Jul 5, 2022
2 parents 01e0a9a + 9e0b351 commit d546858
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/mds/Server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3359,18 +3359,20 @@ CInode* Server::prepare_new_inode(MDRequestRef& mdr, CDir *dir, inodeno_t useino
_inode->truncate_seq = 1; /* starting with 1, 0 is kept for no-truncation logic */

CInode *diri = dir->get_inode();
auto pip = diri->get_projected_inode();

dout(10) << oct << " dir mode 0" << diri->get_inode()->mode << " new mode 0" << mode << dec << dendl;
dout(10) << oct << " dir mode 0" << pip->mode << " new mode 0" << mode << dec << dendl;

if (diri->get_inode()->mode & S_ISGID) {
if (pip->mode & S_ISGID) {
dout(10) << " dir is sticky" << dendl;
_inode->gid = diri->get_inode()->gid;
_inode->gid = pip->gid;
if (S_ISDIR(mode)) {
dout(10) << " new dir also sticky" << dendl;
dout(10) << " new dir also sticky" << dendl;
_inode->mode |= S_ISGID;
}
} else
} else {
_inode->gid = mdr->client_request->get_caller_gid();
}

_inode->uid = mdr->client_request->get_caller_uid();

Expand Down

0 comments on commit d546858

Please sign in to comment.