aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p
diff options
context:
space:
mode:
authorHarsh Prateek Bora <harsh@linux.vnet.ibm.com>2010-08-18 02:01:52 -0400
committerEric Van Hensbergen <ericvh@gmail.com>2010-10-28 10:08:45 -0400
commit7c7298cffc8f4417c95117c2a432f962c066499d (patch)
tree76557c0e621724ee32ddea2748f8b84681ae1ceb /fs/9p
parent8812a3d5f873e28cd08ec8afe328c4182b72db49 (diff)
fs/9p: mkdir fix for setting S_ISGID bit as per parent directory
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>
Diffstat (limited to 'fs/9p')
-rw-r--r--fs/9p/vfs_inode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 88efc161743..c3d200d41dc 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -876,6 +876,8 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir, struct dentry *dentry,
876 v9ses = v9fs_inode2v9ses(dir); 876 v9ses = v9fs_inode2v9ses(dir);
877 877
878 mode |= S_IFDIR; 878 mode |= S_IFDIR;
879 if (dir->i_mode & S_ISGID)
880 mode |= S_ISGID;
879 dir_dentry = v9fs_dentry_from_dir_inode(dir); 881 dir_dentry = v9fs_dentry_from_dir_inode(dir);
880 dfid = v9fs_fid_lookup(dir_dentry); 882 dfid = v9fs_fid_lookup(dir_dentry);
881 if (IS_ERR(dfid)) { 883 if (IS_ERR(dfid)) {