* [PATCH] shmem: support xattr gnu.* namespace for the Hurd
@ 2026-05-15 19:54 Janneke Nieuwenhuizen
0 siblings, 0 replies; 5+ messages in thread
From: Janneke Nieuwenhuizen @ 2026-05-15 19:54 UTC (permalink / raw)
To: lindux-kernel, linux-mm, Hugh Dickins, Baolin Wang
Cc: Ludovic Courtès, Rutger van Beusekom
The Hurd gained[0] support for moving the translator and author
fields out of the inode and into the "gnu.*" xattr namespace.
In anticipation of that, an xattr INDEX was reserved[1]. In 2020, the
Hurd has been brought into compliance[2] with that, and so has ext4[3].
This patch adds support for reading and writing such attributes from
a Linux tmpfs; you can now do something like
mkdir -p hurd-root
mount -t tmpfs -o size=2M tmpfs hurd-root
mkdir -p hurd-root/servers/socket
touch hurd-root/servers/socket/1
setfattr --name=gnu.translator --value='"/hurd/pflocal\0"' \
hurd-root/servers/socket/1
getfattr --name=gnu.translator hurd-root/servers/socket/1
# file: 1
gnu.translator="/hurd/pflocal"
to setup a pipe translator, which is being used to create an initial
file-system image for the Hurd from GNU Guix[4].
[0] https://summerofcode.withgoogle.com/projects/#5869799859027968
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3980bd3b406addb327d858aebd19e229ea340b9a
[2] https://git.savannah.gnu.org/cgit/hurd/hurd.git/commit/?id=a04c7bf83172faa7cb080fbe3b6c04a8415ca645
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=88ee9d571b6d8ed345f877e05f685814412e359b
[4] https://codeberg.org/guix/guix/pulls/8632
---
mm/shmem.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/mm/shmem.c b/mm/shmem.c
index 3b5dc21b323c..5d60aa4dba92 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -15,6 +15,7 @@
* Extended attribute support for tmpfs:
* Copyright (c) 2004, Luke Kenneth Casson Leighton <lkcl@lkcl.net>
* Copyright (c) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
+ * Copyright (C) 2026 Janneke Nieuwenhuizen <janneke@gnu.org>
*
* tiny-shmem:
* Copyright (c) 2004, 2008 Matt Mackall <mpm@selenic.com>
@@ -4371,10 +4372,17 @@ static const struct xattr_handler shmem_user_xattr_handler = {
.set = shmem_xattr_handler_set,
};
+static const struct xattr_handler shmem_hurd_xattr_handler = {
+ .prefix = XATTR_HURD_PREFIX,
+ .get = shmem_xattr_handler_get,
+ .set = shmem_xattr_handler_set,
+};
+
static const struct xattr_handler * const shmem_xattr_handlers[] = {
&shmem_security_xattr_handler,
&shmem_trusted_xattr_handler,
&shmem_user_xattr_handler,
+ &shmem_hurd_xattr_handler,
NULL
};
--
2.54.0
--
Reasonable | Free Software for Correctness | GNU Dezyne -- https://dezyne.org
+Sourcery+ | Correctness for Free Software | https://reasonable-sourcery.coop
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] shmem: support xattr gnu.* namespace for the Hurd
@ 2026-05-15 19:58 Janneke Nieuwenhuizen
2026-05-18 3:54 ` Baolin Wang
2026-05-18 6:35 ` Christoph Hellwig
0 siblings, 2 replies; 5+ messages in thread
From: Janneke Nieuwenhuizen @ 2026-05-15 19:58 UTC (permalink / raw)
To: linux-kernel, linux-mm, Hugh Dickins, Baolin Wang
Cc: Ludovic Courtès, Rutger van Beusekom
From d8291d06b67db045033664fb440f59001d7755a1 Mon Sep 17 00:00:00 2001
From: Janneke Nieuwenhuizen <janneke@gnu.org>
Date: Fri, 15 May 2026 10:12:30 +0200
Subject: [PATCH] shmem: support xattr gnu.* namespace for the Hurd
The Hurd gained[0] support for moving the translator and author
fields out of the inode and into the "gnu.*" xattr namespace.
In anticipation of that, an xattr INDEX was reserved[1]. The Hurd has
now been brought into compliance[2] with that, and so has ext4[3].
This patch adds support for reading and writing such attributes from
a Linux tmpfs; you can now do something like
mkdir -p hurd-root
mount -t tmpfs -o size=2M tmpfs hurd-root
mkdir -p hurd-root/servers/socket
touch hurd-root/servers/socket/1
setfattr --name=gnu.translator --value='"/hurd/pflocal\0"' \
hurd-root/servers/socket/1
getfattr --name=gnu.translator hurd-root/servers/socket/1
# file: 1
gnu.translator="/hurd/pflocal"
to setup a pipe translator, which is being used to create an
initial file-system image for the Hurd from GNU Guix[4].
[0] https://summerofcode.withgoogle.com/projects/#5869799859027968
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3980bd3b406addb327d858aebd19e229ea340b9a
[2] https://git.savannah.gnu.org/cgit/hurd/hurd.git/commit/?id=a04c7bf83172faa7cb080fbe3b6c04a8415ca645
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=88ee9d571b6d8ed345f877e05f685814412e359b
[4] https://codeberg.org/guix/guix/pulls/8632
---
mm/shmem.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/mm/shmem.c b/mm/shmem.c
index 3b5dc21b323c..5d60aa4dba92 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -15,6 +15,7 @@
* Extended attribute support for tmpfs:
* Copyright (c) 2004, Luke Kenneth Casson Leighton <lkcl@lkcl.net>
* Copyright (c) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
+ * Copyright (C) 2026 Janneke Nieuwenhuizen <janneke@gnu.org>
*
* tiny-shmem:
* Copyright (c) 2004, 2008 Matt Mackall <mpm@selenic.com>
@@ -4371,10 +4372,17 @@ static const struct xattr_handler shmem_user_xattr_handler = {
.set = shmem_xattr_handler_set,
};
+static const struct xattr_handler shmem_hurd_xattr_handler = {
+ .prefix = XATTR_HURD_PREFIX,
+ .get = shmem_xattr_handler_get,
+ .set = shmem_xattr_handler_set,
+};
+
static const struct xattr_handler * const shmem_xattr_handlers[] = {
&shmem_security_xattr_handler,
&shmem_trusted_xattr_handler,
&shmem_user_xattr_handler,
+ &shmem_hurd_xattr_handler,
NULL
};
--
2.54.0
--
Reasonable | Free Software for Correctness | GNU Dezyne -- https://dezyne.org
+Sourcery+ | Correctness for Free Software | https://reasonable-sourcery.coop
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] shmem: support xattr gnu.* namespace for the Hurd
2026-05-15 19:58 [PATCH] shmem: support xattr gnu.* namespace for the Hurd Janneke Nieuwenhuizen
@ 2026-05-18 3:54 ` Baolin Wang
2026-05-18 6:22 ` Janneke Nieuwenhuizen
2026-05-18 6:35 ` Christoph Hellwig
1 sibling, 1 reply; 5+ messages in thread
From: Baolin Wang @ 2026-05-18 3:54 UTC (permalink / raw)
To: Janneke Nieuwenhuizen, linux-kernel, linux-mm, Hugh Dickins
Cc: Ludovic Courtès, Rutger van Beusekom, linux-fsdevel
CC fs maillist
On 5/16/26 3:58 AM, Janneke Nieuwenhuizen wrote:
> From d8291d06b67db045033664fb440f59001d7755a1 Mon Sep 17 00:00:00 2001
> From: Janneke Nieuwenhuizen <janneke@gnu.org>
> Date: Fri, 15 May 2026 10:12:30 +0200
> Subject: [PATCH] shmem: support xattr gnu.* namespace for the Hurd
>
> The Hurd gained[0] support for moving the translator and author
> fields out of the inode and into the "gnu.*" xattr namespace.
>
> In anticipation of that, an xattr INDEX was reserved[1]. The Hurd has
> now been brought into compliance[2] with that, and so has ext4[3].
>
> This patch adds support for reading and writing such attributes from
> a Linux tmpfs; you can now do something like
>
> mkdir -p hurd-root
> mount -t tmpfs -o size=2M tmpfs hurd-root
> mkdir -p hurd-root/servers/socket
> touch hurd-root/servers/socket/1
> setfattr --name=gnu.translator --value='"/hurd/pflocal\0"' \
> hurd-root/servers/socket/1
> getfattr --name=gnu.translator hurd-root/servers/socket/1
> # file: 1
> gnu.translator="/hurd/pflocal"
>
> to setup a pipe translator, which is being used to create an
> initial file-system image for the Hurd from GNU Guix[4].
Please add your Singed-off-by tag.
> [0] https://summerofcode.withgoogle.com/projects/#5869799859027968
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3980bd3b406addb327d858aebd19e229ea340b9a
> [2] https://git.savannah.gnu.org/cgit/hurd/hurd.git/commit/?id=a04c7bf83172faa7cb080fbe3b6c04a8415ca645
> [3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=88ee9d571b6d8ed345f877e05f685814412e359b
> [4] https://codeberg.org/guix/guix/pulls/8632
> ---
> mm/shmem.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/mm/shmem.c b/mm/shmem.c
> index 3b5dc21b323c..5d60aa4dba92 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -15,6 +15,7 @@
> * Extended attribute support for tmpfs:
> * Copyright (c) 2004, Luke Kenneth Casson Leighton <lkcl@lkcl.net>
> * Copyright (c) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
> + * Copyright (C) 2026 Janneke Nieuwenhuizen <janneke@gnu.org>
> *
> * tiny-shmem:
> * Copyright (c) 2004, 2008 Matt Mackall <mpm@selenic.com>
> @@ -4371,10 +4372,17 @@ static const struct xattr_handler shmem_user_xattr_handler = {
> .set = shmem_xattr_handler_set,
> };
>
> +static const struct xattr_handler shmem_hurd_xattr_handler = {
> + .prefix = XATTR_HURD_PREFIX,
> + .get = shmem_xattr_handler_get,
> + .set = shmem_xattr_handler_set,
> +};
> +
> static const struct xattr_handler * const shmem_xattr_handlers[] = {
> &shmem_security_xattr_handler,
> &shmem_trusted_xattr_handler,
> &shmem_user_xattr_handler,
> + &shmem_hurd_xattr_handler,
> NULL
> };
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] shmem: support xattr gnu.* namespace for the Hurd
2026-05-18 3:54 ` Baolin Wang
@ 2026-05-18 6:22 ` Janneke Nieuwenhuizen
0 siblings, 0 replies; 5+ messages in thread
From: Janneke Nieuwenhuizen @ 2026-05-18 6:22 UTC (permalink / raw)
To: Baolin Wang
Cc: linux-kernel, linux-mm, Hugh Dickins, Ludovic Courtès,
Rutger van Beusekom, linux-fsdevel
[-- Attachment #1: Type: text/plain, Size: 544 bytes --]
Baolin Wang writes:
Hi Baolin,
> On 5/16/26 3:58 AM, Janneke Nieuwenhuizen wrote:
>> From d8291d06b67db045033664fb440f59001d7755a1 Mon Sep 17 00:00:00 2001
>> From: Janneke Nieuwenhuizen <janneke@gnu.org>
>> Date: Fri, 15 May 2026 10:12:30 +0200
>> Subject: [PATCH] shmem: support xattr gnu.* namespace for the Hurd
[..]
>> to setup a pipe translator, which is being used to create an
>> initial file-system image for the Hurd from GNU Guix[4].
>
> Please add your Singed-off-by tag.
Done; find a new version attached.
Greetings,
Janneke
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-shmem-support-xattr-gnu.-namespace-for-the-Hurd.patch --]
[-- Type: text/x-patch, Size: 2630 bytes --]
From 4ff8927bb044dab11fca9b258e7b9c0b221ac912 Mon Sep 17 00:00:00 2001
From: Janneke Nieuwenhuizen <janneke@gnu.org>
Date: Fri, 15 May 2026 10:12:30 +0200
Subject: [PATCH] shmem: support xattr gnu.* namespace for the Hurd
The Hurd gained[0] support for moving the translator and author
fields out of the inode and into the "gnu.*" xattr namespace.
In anticipation of that, an xattr INDEX was reserved[1]. The Hurd has
now been brought into compliance[2] with that, and so has ext4[3].
This patch adds support for reading and writing such attributes from
a Linux tmpfs; you can now do something like
mkdir -p hurd-root
mount -t tmpfs -o size=2M tmpfs hurd-root
mkdir -p hurd-root/servers/socket
touch hurd-root/servers/socket/1
setfattr --name=gnu.translator --value='"/hurd/pflocal\0"' \
hurd-root/servers/socket/1
getfattr --name=gnu.translator hurd-root/servers/socket/1
# file: 1
gnu.translator="/hurd/pflocal"
to setup a pipe translator, which is being used to create an
initial file-system image for the Hurd from GNU Guix[4].
[0] https://summerofcode.withgoogle.com/projects/#5869799859027968
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3980bd3b406addb327d858aebd19e229ea340b9a
[2] https://git.savannah.gnu.org/cgit/hurd/hurd.git/commit/?id=a04c7bf83172faa7cb080fbe3b6c04a8415ca645
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=88ee9d571b6d8ed345f877e05f685814412e359b
[4] https://codeberg.org/guix/guix/pulls/8632
Signed-off-by: Janneke Nieuwenhuizen <janneke@gnu.org>
---
mm/shmem.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/mm/shmem.c b/mm/shmem.c
index 3b5dc21b323c..5d60aa4dba92 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -15,6 +15,7 @@
* Extended attribute support for tmpfs:
* Copyright (c) 2004, Luke Kenneth Casson Leighton <lkcl@lkcl.net>
* Copyright (c) 2004 Red Hat, Inc., James Morris <jmorris@redhat.com>
+ * Copyright (C) 2026 Janneke Nieuwenhuizen <janneke@gnu.org>
*
* tiny-shmem:
* Copyright (c) 2004, 2008 Matt Mackall <mpm@selenic.com>
@@ -4371,10 +4372,17 @@ static const struct xattr_handler shmem_user_xattr_handler = {
.set = shmem_xattr_handler_set,
};
+static const struct xattr_handler shmem_hurd_xattr_handler = {
+ .prefix = XATTR_HURD_PREFIX,
+ .get = shmem_xattr_handler_get,
+ .set = shmem_xattr_handler_set,
+};
+
static const struct xattr_handler * const shmem_xattr_handlers[] = {
&shmem_security_xattr_handler,
&shmem_trusted_xattr_handler,
&shmem_user_xattr_handler,
+ &shmem_hurd_xattr_handler,
NULL
};
--
2.54.0
[-- Attachment #3: Type: text/plain, Size: 161 bytes --]
--
Reasonable | Free Software for Correctness | GNU Dezyne -- https://dezyne.org
+Sourcery+ | Correctness for Free Software | https://reasonable-sourcery.coop
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] shmem: support xattr gnu.* namespace for the Hurd
2026-05-15 19:58 [PATCH] shmem: support xattr gnu.* namespace for the Hurd Janneke Nieuwenhuizen
2026-05-18 3:54 ` Baolin Wang
@ 2026-05-18 6:35 ` Christoph Hellwig
1 sibling, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2026-05-18 6:35 UTC (permalink / raw)
To: Janneke Nieuwenhuizen
Cc: linux-kernel, linux-mm, Hugh Dickins, Baolin Wang,
Ludovic Courtès, Rutger van Beusekom
On Fri, May 15, 2026 at 09:58:05PM +0200, Janneke Nieuwenhuizen wrote:
> >From d8291d06b67db045033664fb440f59001d7755a1 Mon Sep 17 00:00:00 2001
> From: Janneke Nieuwenhuizen <janneke@gnu.org>
> Date: Fri, 15 May 2026 10:12:30 +0200
> Subject: [PATCH] shmem: support xattr gnu.* namespace for the Hurd
>
> The Hurd gained[0] support for moving the translator and author
> fields out of the inode and into the "gnu.*" xattr namespace.
>
> In anticipation of that, an xattr INDEX was reserved[1]. The Hurd has
> now been brought into compliance[2] with that, and so has ext4[3].
>
> This patch adds support for reading and writing such attributes from
> a Linux tmpfs; you can now do something like
No, making bootstrapping a hobbyist OS is not a good reason to bloat
the Linux kernel. Please patch your bootstrapping code to just use
a user xattr instead.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-05-18 6:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15 19:58 [PATCH] shmem: support xattr gnu.* namespace for the Hurd Janneke Nieuwenhuizen
2026-05-18 3:54 ` Baolin Wang
2026-05-18 6:22 ` Janneke Nieuwenhuizen
2026-05-18 6:35 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2026-05-15 19:54 Janneke Nieuwenhuizen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox