mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] userns: Add forward declaration of struct seq_file in user_namespace.h
@ 2025-05-30  8:35 Herbert Xu
  2025-05-30 13:27 ` Eric W. Biederman
  0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2025-05-30  8:35 UTC (permalink / raw)
  To: Linux Kernel Mailing List, Andrew Morton, Eric W. Biederman

Add forward declaration of struct seq_file before using it in
function prototype.

Fixes: 9cc46516ddf4 ("userns: Add a knob to disable setgroups on a per user namespace basis")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
index a0bb6d012137..5c7aa940b1aa 100644
--- a/include/linux/user_namespace.h
+++ b/include/linux/user_namespace.h
@@ -16,6 +16,8 @@
 #define UID_GID_MAP_MAX_BASE_EXTENTS 5
 #define UID_GID_MAP_MAX_EXTENTS 340
 
+struct seq_file;
+
 struct uid_gid_extent {
 	u32 first;
 	u32 lower_first;
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] userns: Add forward declaration of struct seq_file in user_namespace.h
  2025-05-30  8:35 [PATCH] userns: Add forward declaration of struct seq_file in user_namespace.h Herbert Xu
@ 2025-05-30 13:27 ` Eric W. Biederman
  2025-05-31  7:08   ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Eric W. Biederman @ 2025-05-30 13:27 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Linux Kernel Mailing List, Andrew Morton

Herbert Xu <herbert@gondor.apana.org.au> writes:

> Add forward declaration of struct seq_file before using it in
> function prototype.

I don't see anything wrong with doing that.

However:
> Fixes: 9cc46516ddf4 ("userns: Add a knob to disable setgroups on a per
> user namespace basis")

That description seems to be lacking something.  The code as has been
fine since 2014 and there is no conditional compilation involved.

Did some other change cause a declaration of seq_file not to be present?
Did user_namespace.h get included somewhere new and that new location
doesn't wind up declaring seq_file?

Especially since fixes tags tend to get code back ported I would
appreciate a bit more context on why this is a problem in 2025 when
it hasn't been a problem for the last decade.

Thank you,
Eric Biederman

> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>
> diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
> index a0bb6d012137..5c7aa940b1aa 100644
> --- a/include/linux/user_namespace.h
> +++ b/include/linux/user_namespace.h
> @@ -16,6 +16,8 @@
>  #define UID_GID_MAP_MAX_BASE_EXTENTS 5
>  #define UID_GID_MAP_MAX_EXTENTS 340
>  
> +struct seq_file;
> +
>  struct uid_gid_extent {
>  	u32 first;
>  	u32 lower_first;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] userns: Add forward declaration of struct seq_file in user_namespace.h
  2025-05-30 13:27 ` Eric W. Biederman
@ 2025-05-31  7:08   ` Herbert Xu
  2025-05-31 11:07     ` Eric W. Biederman
  0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2025-05-31  7:08 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Linux Kernel Mailing List, Andrew Morton

On Fri, May 30, 2025 at 08:27:14AM -0500, Eric W. Biederman wrote:
>
> That description seems to be lacking something.  The code as has been
> fine since 2014 and there is no conditional compilation involved.

I'm happy to drop the fixes header.  There is no need to backport
this.

> Did some other change cause a declaration of seq_file not to be present?
> Did user_namespace.h get included somewhere new and that new location
> doesn't wind up declaring seq_file?

The seq_file forward declaration is currently being provided by
linux/sched.h.  I tried removing it and found this issue.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] userns: Add forward declaration of struct seq_file in user_namespace.h
  2025-05-31  7:08   ` Herbert Xu
@ 2025-05-31 11:07     ` Eric W. Biederman
  0 siblings, 0 replies; 4+ messages in thread
From: Eric W. Biederman @ 2025-05-31 11:07 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Linux Kernel Mailing List, Andrew Morton

Herbert Xu <herbert@gondor.apana.org.au> writes:

> On Fri, May 30, 2025 at 08:27:14AM -0500, Eric W. Biederman wrote:
>>
>> That description seems to be lacking something.  The code as has been
>> fine since 2014 and there is no conditional compilation involved.
>
> I'm happy to drop the fixes header.  There is no need to backport
> this.

The fixes tag isn't wrong.

>> Did some other change cause a declaration of seq_file not to be present?
>> Did user_namespace.h get included somewhere new and that new location
>> doesn't wind up declaring seq_file?
>
> The seq_file forward declaration is currently being provided by
> linux/sched.h.  I tried removing it and found this issue.

Thanks.

That is the interesting information that I would appreciate to see
in the change log.

If someone has to play code archaeologist and has to look at the
history, this is exactly the information that is needed to understand
why the change was made.

Eric


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-05-31 11:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-30  8:35 [PATCH] userns: Add forward declaration of struct seq_file in user_namespace.h Herbert Xu
2025-05-30 13:27 ` Eric W. Biederman
2025-05-31  7:08   ` Herbert Xu
2025-05-31 11:07     ` Eric W. Biederman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®