Skip to content

Commit

Permalink
fs/9p: mkdir fix for setting S_ISGID bit as per parent directory
Browse files Browse the repository at this point in the history
The current implementation of 9p client mkdir function does not
set the S_ISGID mode bit for the directory being created if the
parent directory has this bit set. This patch fixes this problem
so that the newly created directory inherits the gid from parent
directory and not from the process creating this directory, when
the S_ISGID bit is set in parent directory.

Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
  • Loading branch information
Harsh Prateek Bora authored and Eric Van Hensbergen committed Oct 28, 2010
1 parent 8812a3d commit 7c7298c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/9p/vfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,8 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir, struct dentry *dentry,
v9ses = v9fs_inode2v9ses(dir);

mode |= S_IFDIR;
if (dir->i_mode & S_ISGID)
mode |= S_ISGID;
dir_dentry = v9fs_dentry_from_dir_inode(dir);
dfid = v9fs_fid_lookup(dir_dentry);
if (IS_ERR(dfid)) {
Expand Down

0 comments on commit 7c7298c

Please sign in to comment.