* [PATCH 1/5] ext2: cache NULL when both default_acl and acl are NULL
@ 2018-08-14 14:16 Chengguang Xu
2018-08-14 14:16 ` [PATCH 2/5] ext4: " Chengguang Xu
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Chengguang Xu @ 2018-08-14 14:16 UTC (permalink / raw)
To: jack, tytso, adilger.kernel, jaegeuk, yuchao0, shaggy, hubcap, martin
Cc: devel, linux-kernel, linux-ext4, linux-f2fs-devel,
jfs-discussion, Chengguang Xu
default_acl and acl of newly created inode will be initiated
as ACL_NOT_CACHED in vfs function inode_init_always() and later
will be updated by calling xxx_init_acl() in specific filesystems.
Howerver, when default_acl and acl are NULL then they keep the value
of ACL_NOT_CACHED, this patch tries to cache NULL for acl/default_acl
in this case.
Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
fs/ext2/acl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c
index 224c04abb2e5..74411e8ea507 100644
--- a/fs/ext2/acl.c
+++ b/fs/ext2/acl.c
@@ -262,5 +262,8 @@ ext2_init_acl(struct inode *inode, struct inode *dir)
error = __ext2_set_acl(inode, acl, ACL_TYPE_ACCESS);
posix_acl_release(acl);
}
+ if (!default_acl && !acl)
+ cache_no_acl(inode);
+
return error;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/5] ext4: cache NULL when both default_acl and acl are NULL
2018-08-14 14:16 [PATCH 1/5] ext2: cache NULL when both default_acl and acl are NULL Chengguang Xu
@ 2018-08-14 14:16 ` Chengguang Xu
2018-08-14 14:16 ` [PATCH 3/5] f2fs: " Chengguang Xu
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Chengguang Xu @ 2018-08-14 14:16 UTC (permalink / raw)
To: jack, tytso, adilger.kernel, jaegeuk, yuchao0, shaggy, hubcap, martin
Cc: devel, linux-kernel, linux-ext4, linux-f2fs-devel,
jfs-discussion, Chengguang Xu
default_acl and acl of newly created inode will be initiated
as ACL_NOT_CACHED in vfs function inode_init_always() and later
will be updated by calling xxx_init_acl() in specific filesystems.
Howerver, when default_acl and acl are NULL then they keep the value
of ACL_NOT_CACHED, this patch tries to cache NULL for acl/default_acl
in this case.
Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
fs/ext4/acl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c
index fb50f9aa6ead..69a01d28356d 100644
--- a/fs/ext4/acl.c
+++ b/fs/ext4/acl.c
@@ -291,5 +291,8 @@ ext4_init_acl(handle_t *handle, struct inode *inode, struct inode *dir)
acl, XATTR_CREATE);
posix_acl_release(acl);
}
+ if (!default_acl && !acl)
+ cache_no_acl(inode);
+
return error;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] f2fs: cache NULL when both default_acl and acl are NULL
2018-08-14 14:16 [PATCH 1/5] ext2: cache NULL when both default_acl and acl are NULL Chengguang Xu
2018-08-14 14:16 ` [PATCH 2/5] ext4: " Chengguang Xu
@ 2018-08-14 14:16 ` Chengguang Xu
2018-08-14 14:16 ` [PATCH 4/5] jfs: " Chengguang Xu
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Chengguang Xu @ 2018-08-14 14:16 UTC (permalink / raw)
To: jack, tytso, adilger.kernel, jaegeuk, yuchao0, shaggy, hubcap, martin
Cc: devel, linux-kernel, linux-ext4, linux-f2fs-devel,
jfs-discussion, Chengguang Xu
default_acl and acl of newly created inode will be initiated
as ACL_NOT_CACHED in vfs function inode_init_always() and later
will be updated by calling xxx_init_acl() in specific filesystems.
Howerver, when default_acl and acl are NULL then they keep the value
of ACL_NOT_CACHED, this patch tries to cache NULL for acl/default_acl
in this case.
Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
fs/f2fs/acl.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c
index 111824199a88..97ed555316be 100644
--- a/fs/f2fs/acl.c
+++ b/fs/f2fs/acl.c
@@ -401,6 +401,8 @@ int f2fs_init_acl(struct inode *inode, struct inode *dir, struct page *ipage,
ipage);
posix_acl_release(acl);
}
+ if (!default_acl && !acl)
+ cache_no_acl(inode);
return error;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] jfs: cache NULL when both default_acl and acl are NULL
2018-08-14 14:16 [PATCH 1/5] ext2: cache NULL when both default_acl and acl are NULL Chengguang Xu
2018-08-14 14:16 ` [PATCH 2/5] ext4: " Chengguang Xu
2018-08-14 14:16 ` [PATCH 3/5] f2fs: " Chengguang Xu
@ 2018-08-14 14:16 ` Chengguang Xu
2018-08-14 14:16 ` [PATCH 5/5] orangefs: " Chengguang Xu
2018-08-29 13:18 ` [PATCH 1/5] ext2: " Jan Kara
4 siblings, 0 replies; 6+ messages in thread
From: Chengguang Xu @ 2018-08-14 14:16 UTC (permalink / raw)
To: jack, tytso, adilger.kernel, jaegeuk, yuchao0, shaggy, hubcap, martin
Cc: devel, linux-kernel, linux-ext4, linux-f2fs-devel,
jfs-discussion, Chengguang Xu
default_acl and acl of newly created inode will be initiated
as ACL_NOT_CACHED in vfs function inode_init_always() and later
will be updated by calling xxx_init_acl() in specific filesystems.
Howerver, when default_acl and acl are NULL then they keep the value
of ACL_NOT_CACHED, this patch tries to cache NULL for acl/default_acl
in this case.
Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
fs/jfs/acl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c
index 2e71b6e7e646..15b9a9b74d72 100644
--- a/fs/jfs/acl.c
+++ b/fs/jfs/acl.c
@@ -154,6 +154,9 @@ int jfs_init_acl(tid_t tid, struct inode *inode, struct inode *dir)
posix_acl_release(acl);
}
+ if (!default_acl && !acl)
+ cache_no_acl(inode);
+
JFS_IP(inode)->mode2 = (JFS_IP(inode)->mode2 & 0xffff0000) |
inode->i_mode;
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/5] orangefs: cache NULL when both default_acl and acl are NULL
2018-08-14 14:16 [PATCH 1/5] ext2: cache NULL when both default_acl and acl are NULL Chengguang Xu
` (2 preceding siblings ...)
2018-08-14 14:16 ` [PATCH 4/5] jfs: " Chengguang Xu
@ 2018-08-14 14:16 ` Chengguang Xu
2018-08-29 13:18 ` [PATCH 1/5] ext2: " Jan Kara
4 siblings, 0 replies; 6+ messages in thread
From: Chengguang Xu @ 2018-08-14 14:16 UTC (permalink / raw)
To: jack, tytso, adilger.kernel, jaegeuk, yuchao0, shaggy, hubcap, martin
Cc: devel, linux-kernel, linux-ext4, linux-f2fs-devel,
jfs-discussion, Chengguang Xu
default_acl and acl of newly created inode will be initiated
as ACL_NOT_CACHED in vfs function inode_init_always() and later
will be updated by calling xxx_init_acl() in specific filesystems.
Howerver, when default_acl and acl are NULL then they keep the value
of ACL_NOT_CACHED, this patch tries to cache NULL for acl/default_acl
in this case.
Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
fs/orangefs/acl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/orangefs/acl.c b/fs/orangefs/acl.c
index 10587413b20e..e3b043a263bc 100644
--- a/fs/orangefs/acl.c
+++ b/fs/orangefs/acl.c
@@ -175,6 +175,9 @@ int orangefs_init_acl(struct inode *inode, struct inode *dir)
posix_acl_release(acl);
}
+ if (!default_acl && !acl)
+ cache_no_acl(inode);
+
/* If mode of the inode was changed, then do a forcible ->setattr */
if (mode != inode->i_mode) {
memset(&iattr, 0, sizeof iattr);
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/5] ext2: cache NULL when both default_acl and acl are NULL
2018-08-14 14:16 [PATCH 1/5] ext2: cache NULL when both default_acl and acl are NULL Chengguang Xu
` (3 preceding siblings ...)
2018-08-14 14:16 ` [PATCH 5/5] orangefs: " Chengguang Xu
@ 2018-08-29 13:18 ` Jan Kara
4 siblings, 0 replies; 6+ messages in thread
From: Jan Kara @ 2018-08-29 13:18 UTC (permalink / raw)
To: Chengguang Xu
Cc: jack, tytso, adilger.kernel, jaegeuk, yuchao0, shaggy, hubcap,
martin, devel, linux-kernel, linux-ext4, linux-f2fs-devel,
jfs-discussion
On Tue 14-08-18 22:16:30, Chengguang Xu wrote:
> default_acl and acl of newly created inode will be initiated
> as ACL_NOT_CACHED in vfs function inode_init_always() and later
> will be updated by calling xxx_init_acl() in specific filesystems.
> Howerver, when default_acl and acl are NULL then they keep the value
> of ACL_NOT_CACHED, this patch tries to cache NULL for acl/default_acl
> in this case.
>
> Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
> ---
> fs/ext2/acl.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c
> index 224c04abb2e5..74411e8ea507 100644
> --- a/fs/ext2/acl.c
> +++ b/fs/ext2/acl.c
> @@ -262,5 +262,8 @@ ext2_init_acl(struct inode *inode, struct inode *dir)
> error = __ext2_set_acl(inode, acl, ACL_TYPE_ACCESS);
> posix_acl_release(acl);
> }
> + if (!default_acl && !acl)
> + cache_no_acl(inode);
> +
Thanks for the patch. I'd somewhat prefer something equivalent to:
if (!acl)
inode->i_acl = NULL;
if (!default_acl)
inode->i_default_acl = NULL;
given the code in ext2_init_acl(). It would be most natural like:
if (default_acl) {
do foo
} else {
inode->i_default_acl = NULL;
}
And similarly for 'acl'.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-08-29 13:18 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-14 14:16 [PATCH 1/5] ext2: cache NULL when both default_acl and acl are NULL Chengguang Xu
2018-08-14 14:16 ` [PATCH 2/5] ext4: " Chengguang Xu
2018-08-14 14:16 ` [PATCH 3/5] f2fs: " Chengguang Xu
2018-08-14 14:16 ` [PATCH 4/5] jfs: " Chengguang Xu
2018-08-14 14:16 ` [PATCH 5/5] orangefs: " Chengguang Xu
2018-08-29 13:18 ` [PATCH 1/5] ext2: " Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).