Re: [PATCH] tmpfs: escape the space in the mpol mount option

From: Andrew Morton

Date: Sun Nov 29 2026 - 21:12:49 EST


On Sun, 29 Nov 2026 18:09:05 -0800 Yifan Feng <evanfengff@xxxxxxxxx> wrote:

> On Sat, 28 Nov 2026 18:13:19 -0800 Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> > > # mount -t tmpfs -o 'mpol=prefer (many):0-1' none /mnt
> >
> > what's in /proc mounts at this point?
>
> none /mnt tmpfs rw,relatime,inode64,mpol=prefer (many):0-1 0 0
>
> That is seven fields where six are expected. findmnt and getmntent()
> stop at the space, so the options they return end in "mpol=prefer".
>
> > and what does /proc/mounts look like after making this change?
>
> After the mount:
>
> none /mnt tmpfs rw,relatime,inode64,mpol=prefer\040(many):0-1 0 0
>
> After the remount with size=128M:
>
> none /mnt tmpfs rw,relatime,size=131072k,inode64,mpol=prefer\040(many):0-1 0 0
>
> findmnt and getmntent() decode the \040, and the options they return
> end in "mpol=prefer (many):0-1".

Great, thanks.

> I can send a v2 with these lines in the changelog if you prefer.

If you could please. I expect David will be processing this patch.