Whamcloud - gitweb
LU-12266 mdd: fix up non-dir creation in SGID dirs 29/34829/3
authorSebastien Buisson <sbuisson@ddn.com>
Mon, 6 May 2019 11:07:58 +0000 (20:07 +0900)
committerOleg Drokin <green@whamcloud.com>
Fri, 10 May 2019 21:03:44 +0000 (21:03 +0000)
commit51a24b995e91b3d72c4ab02257e701824bae8506
treec403f52ce7ed3b815874d1d582dab8f062436785
parent672e85cfb90746349a544264d648612a1a7c8e49
LU-12266 mdd: fix up non-dir creation in SGID dirs

sgid directories have special semantics, making newly created files in
the directory belong to the group of the directory, and newly created
subdirectories will also become sgid. This is historically used for
group-shared directories.

But group directories writable by non-group members should not imply
that such non-group members can magically join the group, so make sure
to clear the sgid bit on non-directories for non-members (but remember
that sgid without group execute means "mandatory locking", just to
confuse things even more).

Adapt fix from inode_init_owner() to use in mdd_create_sanity_check().

Lustre-change: https://review.whamcloud.com/34809
Lustre-commit: 534f10e45ab1f575a0a0c81964d4792ec33696fa

Linux-commit: 0fa3ecd87848c9c93c2c828ef4c3a8ca36ce46c7

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Iae253c5cc7865fc81574760ce0ed4d93698b7314
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/34829
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdd/mdd_dir.c
lustre/tests/sanity.sh