All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Xu <xuyang2018.jy@fujitsu.com>
To: <linux-fsdevel@vger.kernel.org>
Cc: <ceph-devel@vger.kernel.org>, <linux-nfs@vger.kernel.org>,
	<linux-xfs@vger.kernel.org>, <viro@zeniv.linux.org.uk>,
	<david@fromorbit.com>, <djwong@kernel.org>, <brauner@kernel.org>,
	<jlayton@kernel.org>, <ntfs3@lists.linux.dev>, <chao@kernel.org>,
	<linux-f2fs-devel@lists.sourceforge.net>,
	Yang Xu <xuyang2018.jy@fujitsu.com>
Subject: [PATCH v4 3/8] xfs: only call posix_acl_create under CONFIG_XFS_POSIX_ACL
Date: Tue, 19 Apr 2022 19:47:09 +0800	[thread overview]
Message-ID: <1650368834-2420-3-git-send-email-xuyang2018.jy@fujitsu.com> (raw)
In-Reply-To: <1650368834-2420-1-git-send-email-xuyang2018.jy@fujitsu.com>

Since xfs_generic_create only calls xfs_set_acl when enable this kconfig, we
don't need to call posix_acl_create for the !CONFIG_XFS_POSIX_ACL case.

The previous patch has added missing umask strip for tmpfile, so all creation
paths handle umask in the vfs directly if the filesystem doesn't support or
enable POSIX ACLs.

So just put this function under CONFIG_XFS_POSIX_ACL and umask strip still works
well.

Also use unified rule for CONFIG_XFS_POSIX_ACL in this file, so use IS_ENABLED in
xfs_generic_create.

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 fs/xfs/xfs_iops.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index b34e8e4344a8..6b8df9ab215a 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -150,6 +150,7 @@ xfs_create_need_xattr(
 		return true;
 	if (default_acl)
 		return true;
+
 #if IS_ENABLED(CONFIG_SECURITY)
 	if (dir->i_sb->s_security)
 		return true;
@@ -169,7 +170,7 @@ xfs_generic_create(
 {
 	struct inode	*inode;
 	struct xfs_inode *ip = NULL;
-	struct posix_acl *default_acl, *acl;
+	struct posix_acl *default_acl = NULL, *acl = NULL;
 	struct xfs_name	name;
 	int		error;
 
@@ -184,9 +185,11 @@ xfs_generic_create(
 		rdev = 0;
 	}
 
+#if IS_ENABLED(CONFIG_XFS_POSIX_ACL)
 	error = posix_acl_create(dir, &mode, &default_acl, &acl);
 	if (error)
 		return error;
+#endif
 
 	/* Verify mode is valid also for tmpfile case */
 	error = xfs_dentry_mode_to_name(&name, dentry, mode);
@@ -209,7 +212,7 @@ xfs_generic_create(
 	if (unlikely(error))
 		goto out_cleanup_inode;
 
-#ifdef CONFIG_XFS_POSIX_ACL
+#if IS_ENABLED(CONFIG_XFS_POSIX_ACL)
 	if (default_acl) {
 		error = __xfs_set_acl(inode, default_acl, ACL_TYPE_DEFAULT);
 		if (error)
-- 
2.27.0


WARNING: multiple messages have this Message-ID (diff)
From: Yang Xu <xuyang2018.jy@fujitsu.com>
To: <linux-fsdevel@vger.kernel.org>
Cc: linux-nfs@vger.kernel.org, Yang Xu <xuyang2018.jy@fujitsu.com>,
	djwong@kernel.org, david@fromorbit.com, brauner@kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-xfs@vger.kernel.org, viro@zeniv.linux.org.uk,
	jlayton@kernel.org, ceph-devel@vger.kernel.org,
	ntfs3@lists.linux.dev
Subject: [f2fs-dev] [PATCH v4 3/8] xfs: only call posix_acl_create under CONFIG_XFS_POSIX_ACL
Date: Tue, 19 Apr 2022 19:47:09 +0800	[thread overview]
Message-ID: <1650368834-2420-3-git-send-email-xuyang2018.jy@fujitsu.com> (raw)
In-Reply-To: <1650368834-2420-1-git-send-email-xuyang2018.jy@fujitsu.com>

Since xfs_generic_create only calls xfs_set_acl when enable this kconfig, we
don't need to call posix_acl_create for the !CONFIG_XFS_POSIX_ACL case.

The previous patch has added missing umask strip for tmpfile, so all creation
paths handle umask in the vfs directly if the filesystem doesn't support or
enable POSIX ACLs.

So just put this function under CONFIG_XFS_POSIX_ACL and umask strip still works
well.

Also use unified rule for CONFIG_XFS_POSIX_ACL in this file, so use IS_ENABLED in
xfs_generic_create.

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 fs/xfs/xfs_iops.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index b34e8e4344a8..6b8df9ab215a 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -150,6 +150,7 @@ xfs_create_need_xattr(
 		return true;
 	if (default_acl)
 		return true;
+
 #if IS_ENABLED(CONFIG_SECURITY)
 	if (dir->i_sb->s_security)
 		return true;
@@ -169,7 +170,7 @@ xfs_generic_create(
 {
 	struct inode	*inode;
 	struct xfs_inode *ip = NULL;
-	struct posix_acl *default_acl, *acl;
+	struct posix_acl *default_acl = NULL, *acl = NULL;
 	struct xfs_name	name;
 	int		error;
 
@@ -184,9 +185,11 @@ xfs_generic_create(
 		rdev = 0;
 	}
 
+#if IS_ENABLED(CONFIG_XFS_POSIX_ACL)
 	error = posix_acl_create(dir, &mode, &default_acl, &acl);
 	if (error)
 		return error;
+#endif
 
 	/* Verify mode is valid also for tmpfile case */
 	error = xfs_dentry_mode_to_name(&name, dentry, mode);
@@ -209,7 +212,7 @@ xfs_generic_create(
 	if (unlikely(error))
 		goto out_cleanup_inode;
 
-#ifdef CONFIG_XFS_POSIX_ACL
+#if IS_ENABLED(CONFIG_XFS_POSIX_ACL)
 	if (default_acl) {
 		error = __xfs_set_acl(inode, default_acl, ACL_TYPE_DEFAULT);
 		if (error)
-- 
2.27.0



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  parent reply	other threads:[~2022-04-19 10:46 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 11:47 [PATCH v4 1/8] fs: move sgid strip operation from inode_init_owner into inode_sgid_strip Yang Xu
2022-04-19 11:47 ` [f2fs-dev] " Yang Xu
2022-04-19 11:47 ` [PATCH v4 2/8] fs: Add missing umask strip in vfs_tmpfile Yang Xu
2022-04-19 11:47   ` [f2fs-dev] " Yang Xu
2022-04-19 11:47 ` Yang Xu [this message]
2022-04-19 11:47   ` [f2fs-dev] [PATCH v4 3/8] xfs: only call posix_acl_create under CONFIG_XFS_POSIX_ACL Yang Xu
2022-04-19 13:53   ` Christian Brauner
2022-04-19 13:53     ` [f2fs-dev] " Christian Brauner
2022-04-20  1:12     ` xuyang2018.jy
2022-04-20  1:12       ` [f2fs-dev] " xuyang2018.jy
2022-04-20  4:49   ` Christoph Hellwig
2022-04-20  4:49     ` [f2fs-dev] " Christoph Hellwig
2022-04-19 11:47 ` [PATCH v4 4/8] NFSv3: only do posix_acl_create under CONFIG_NFS_V3_ACL Yang Xu
2022-04-19 11:47   ` [f2fs-dev] " Yang Xu
2022-04-19 13:59   ` Christian Brauner
2022-04-19 13:59     ` [f2fs-dev] " Christian Brauner
2022-04-19 14:11     ` Trond Myklebust
2022-04-19 14:11       ` [f2fs-dev] " Trond Myklebust
2022-04-20  1:12       ` xuyang2018.jy
2022-04-20  1:12         ` [f2fs-dev] " xuyang2018.jy
2022-04-19 11:47 ` [PATCH v4 5/8] f2fs: Remove useless NULL assign value for acl and default_acl Yang Xu
2022-04-19 11:47   ` [f2fs-dev] " Yang Xu
2022-04-19 14:02   ` Christian Brauner
2022-04-19 14:02     ` [f2fs-dev] " Christian Brauner
2022-04-20  1:14     ` xuyang2018.jy
2022-04-20  1:14       ` [f2fs-dev] " xuyang2018.jy
2022-04-19 11:47 ` [PATCH v4 6/8] ntfs3: Use the same order for acl pointer check in ntfs_init_acl Yang Xu
2022-04-19 11:47   ` [f2fs-dev] " Yang Xu
2022-04-19 14:03   ` Christian Brauner
2022-04-19 14:03     ` [f2fs-dev] " Christian Brauner
2022-04-20  1:15     ` xuyang2018.jy
2022-04-20  1:15       ` [f2fs-dev] " xuyang2018.jy
2022-04-19 11:47 ` [PATCH v4 7/8] fs: strip file's S_ISGID mode on vfs instead of on underlying filesystem Yang Xu
2022-04-19 11:47   ` [f2fs-dev] " Yang Xu
2022-04-19 14:09   ` Christian Brauner
2022-04-19 14:09     ` [f2fs-dev] " Christian Brauner
2022-04-20  1:16     ` xuyang2018.jy
2022-04-20  1:16       ` [f2fs-dev] " xuyang2018.jy
2022-04-19 11:47 ` [PATCH v4 8/8] ceph: Remove S_ISGID clear code in ceph_finish_async_create Yang Xu
2022-04-19 11:47   ` [f2fs-dev] " Yang Xu
2022-04-19 14:05 ` [PATCH v4 1/8] fs: move sgid strip operation from inode_init_owner into inode_sgid_strip Christian Brauner
2022-04-19 14:05   ` [f2fs-dev] " Christian Brauner
2022-04-20  1:27   ` xuyang2018.jy
2022-04-20  1:27     ` [f2fs-dev] " xuyang2018.jy
2022-04-20 21:52     ` Dave Chinner
2022-04-20 21:52       ` [f2fs-dev] " Dave Chinner
2022-04-21  1:11       ` xuyang2018.jy
2022-04-21  1:11         ` [f2fs-dev] " xuyang2018.jy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1650368834-2420-3-git-send-email-xuyang2018.jy@fujitsu.com \
    --to=xuyang2018.jy@fujitsu.com \
    --cc=brauner@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=chao@kernel.org \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ntfs3@lists.linux.dev \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.