fs: add a new SB_I_NOUMASK flag
authorJeff Layton <jlayton@kernel.org>
Tue, 12 Sep 2023 00:25:50 +0000 (20:25 -0400)
committerChristian Brauner <brauner@kernel.org>
Thu, 19 Oct 2023 09:02:47 +0000 (11:02 +0200)
commit5aa8fd9cea2ee0d42c5d92c5eacf0a14bbc4c293
tree055147b2649fad285c863547c41cba7d766761bc
parent84d2b696236c63836011f04d13d3f09ed47fa560
fs: add a new SB_I_NOUMASK flag

SB_POSIXACL must be set when a filesystem supports POSIX ACLs, but NFSv4
also sets this flag to prevent the VFS from applying the umask on
newly-created files. NFSv4 doesn't support POSIX ACLs however, which
causes confusion when other subsystems try to test for them.

Add a new SB_I_NOUMASK flag that allows filesystems to opt-in to umask
stripping without advertising support for POSIX ACLs. Set the new flag
on NFSv4 instead of SB_POSIXACL.

Also, move mode_strip_umask to namei.h and convert init_mknod and
init_mkdir to use it.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Message-Id: <20230911-acl-fix-v3-1-b25315333f6c@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/init.c
fs/namei.c
fs/nfs/super.c
include/linux/fs.h
include/linux/namei.h