* [PATCH] selinux: Remove redundant __GFP_NOWARN
@ 2025-08-07 14:05 Qianfeng Rong
2025-08-11 14:11 ` Stephen Smalley
2025-08-12 17:18 ` Paul Moore
0 siblings, 2 replies; 3+ messages in thread
From: Qianfeng Rong @ 2025-08-07 14:05 UTC (permalink / raw)
To: Paul Moore, Stephen Smalley, Ondrej Mosnacek, selinux,
linux-kernel
Cc: Qianfeng Rong
Commit 16f5dfbc851b ("gfp: include __GFP_NOWARN in GFP_NOWAIT")
made GFP_NOWAIT implicitly include __GFP_NOWARN.
Therefore, explicit __GFP_NOWARN combined with GFP_NOWAIT
(e.g., `GFP_NOWAIT | __GFP_NOWARN`) is now redundant. Let's clean
up these redundant flags across subsystems.
No functional changes.
Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
security/selinux/avc.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index 4b4837a20225..c70053f2806e 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -293,26 +293,26 @@ static struct avc_xperms_decision_node
struct extended_perms_decision *xpd;
xpd_node = kmem_cache_zalloc(avc_xperms_decision_cachep,
- GFP_NOWAIT | __GFP_NOWARN);
+ GFP_NOWAIT);
if (!xpd_node)
return NULL;
xpd = &xpd_node->xpd;
if (which & XPERMS_ALLOWED) {
xpd->allowed = kmem_cache_zalloc(avc_xperms_data_cachep,
- GFP_NOWAIT | __GFP_NOWARN);
+ GFP_NOWAIT);
if (!xpd->allowed)
goto error;
}
if (which & XPERMS_AUDITALLOW) {
xpd->auditallow = kmem_cache_zalloc(avc_xperms_data_cachep,
- GFP_NOWAIT | __GFP_NOWARN);
+ GFP_NOWAIT);
if (!xpd->auditallow)
goto error;
}
if (which & XPERMS_DONTAUDIT) {
xpd->dontaudit = kmem_cache_zalloc(avc_xperms_data_cachep,
- GFP_NOWAIT | __GFP_NOWARN);
+ GFP_NOWAIT);
if (!xpd->dontaudit)
goto error;
}
@@ -340,7 +340,7 @@ static struct avc_xperms_node *avc_xperms_alloc(void)
{
struct avc_xperms_node *xp_node;
- xp_node = kmem_cache_zalloc(avc_xperms_cachep, GFP_NOWAIT | __GFP_NOWARN);
+ xp_node = kmem_cache_zalloc(avc_xperms_cachep, GFP_NOWAIT);
if (!xp_node)
return xp_node;
INIT_LIST_HEAD(&xp_node->xpd_head);
@@ -495,7 +495,7 @@ static struct avc_node *avc_alloc_node(void)
{
struct avc_node *node;
- node = kmem_cache_zalloc(avc_node_cachep, GFP_NOWAIT | __GFP_NOWARN);
+ node = kmem_cache_zalloc(avc_node_cachep, GFP_NOWAIT);
if (!node)
goto out;
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] selinux: Remove redundant __GFP_NOWARN
2025-08-07 14:05 [PATCH] selinux: Remove redundant __GFP_NOWARN Qianfeng Rong
@ 2025-08-11 14:11 ` Stephen Smalley
2025-08-12 17:18 ` Paul Moore
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Smalley @ 2025-08-11 14:11 UTC (permalink / raw)
To: Qianfeng Rong; +Cc: Paul Moore, Ondrej Mosnacek, selinux, linux-kernel
On Thu, Aug 7, 2025 at 10:06 AM Qianfeng Rong <rongqianfeng@vivo.com> wrote:
>
> Commit 16f5dfbc851b ("gfp: include __GFP_NOWARN in GFP_NOWAIT")
> made GFP_NOWAIT implicitly include __GFP_NOWARN.
>
> Therefore, explicit __GFP_NOWARN combined with GFP_NOWAIT
> (e.g., `GFP_NOWAIT | __GFP_NOWARN`) is now redundant. Let's clean
> up these redundant flags across subsystems.
>
> No functional changes.
>
> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
> ---
> security/selinux/avc.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/security/selinux/avc.c b/security/selinux/avc.c
> index 4b4837a20225..c70053f2806e 100644
> --- a/security/selinux/avc.c
> +++ b/security/selinux/avc.c
> @@ -293,26 +293,26 @@ static struct avc_xperms_decision_node
> struct extended_perms_decision *xpd;
>
> xpd_node = kmem_cache_zalloc(avc_xperms_decision_cachep,
> - GFP_NOWAIT | __GFP_NOWARN);
> + GFP_NOWAIT);
> if (!xpd_node)
> return NULL;
>
> xpd = &xpd_node->xpd;
> if (which & XPERMS_ALLOWED) {
> xpd->allowed = kmem_cache_zalloc(avc_xperms_data_cachep,
> - GFP_NOWAIT | __GFP_NOWARN);
> + GFP_NOWAIT);
> if (!xpd->allowed)
> goto error;
> }
> if (which & XPERMS_AUDITALLOW) {
> xpd->auditallow = kmem_cache_zalloc(avc_xperms_data_cachep,
> - GFP_NOWAIT | __GFP_NOWARN);
> + GFP_NOWAIT);
> if (!xpd->auditallow)
> goto error;
> }
> if (which & XPERMS_DONTAUDIT) {
> xpd->dontaudit = kmem_cache_zalloc(avc_xperms_data_cachep,
> - GFP_NOWAIT | __GFP_NOWARN);
> + GFP_NOWAIT);
> if (!xpd->dontaudit)
> goto error;
> }
> @@ -340,7 +340,7 @@ static struct avc_xperms_node *avc_xperms_alloc(void)
> {
> struct avc_xperms_node *xp_node;
>
> - xp_node = kmem_cache_zalloc(avc_xperms_cachep, GFP_NOWAIT | __GFP_NOWARN);
> + xp_node = kmem_cache_zalloc(avc_xperms_cachep, GFP_NOWAIT);
> if (!xp_node)
> return xp_node;
> INIT_LIST_HEAD(&xp_node->xpd_head);
> @@ -495,7 +495,7 @@ static struct avc_node *avc_alloc_node(void)
> {
> struct avc_node *node;
>
> - node = kmem_cache_zalloc(avc_node_cachep, GFP_NOWAIT | __GFP_NOWARN);
> + node = kmem_cache_zalloc(avc_node_cachep, GFP_NOWAIT);
> if (!node)
> goto out;
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] selinux: Remove redundant __GFP_NOWARN
2025-08-07 14:05 [PATCH] selinux: Remove redundant __GFP_NOWARN Qianfeng Rong
2025-08-11 14:11 ` Stephen Smalley
@ 2025-08-12 17:18 ` Paul Moore
1 sibling, 0 replies; 3+ messages in thread
From: Paul Moore @ 2025-08-12 17:18 UTC (permalink / raw)
To: Qianfeng Rong, Stephen Smalley, Ondrej Mosnacek, selinux,
linux-kernel
Cc: Qianfeng Rong
On Aug 7, 2025 Qianfeng Rong <rongqianfeng@vivo.com> wrote:
>
> Commit 16f5dfbc851b ("gfp: include __GFP_NOWARN in GFP_NOWAIT")
> made GFP_NOWAIT implicitly include __GFP_NOWARN.
>
> Therefore, explicit __GFP_NOWARN combined with GFP_NOWAIT
> (e.g., `GFP_NOWAIT | __GFP_NOWARN`) is now redundant. Let's clean
> up these redundant flags across subsystems.
>
> No functional changes.
>
> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
> Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
> ---
> security/selinux/avc.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
Merged into selinux/dev with some minor tweaks to line wrapping and
horizontal alignment, thanks.
--
paul-moore.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-12 17:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-07 14:05 [PATCH] selinux: Remove redundant __GFP_NOWARN Qianfeng Rong
2025-08-11 14:11 ` Stephen Smalley
2025-08-12 17:18 ` Paul Moore
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).