Re: [RFC PATCH 3/6] mm: nommu: fix an issue on map request to /dev/zero
Greg Kroah-Hartman <[email protected]>
| Newsgroups | org.kernel.vger.linux-fsdevel,org.kvack.linux-mm |
|---|---|
| Message-ID | <2026081330-music-peso-26c2@gregkh> |
On Thu, Aug 13, 2026 at 02:22:03PM +0100, Matthew Wilcox wrote:
> On Thu, Aug 13, 2026 at 09:19:47PM +0900, Greg Kroah-Hartman wrote:
> > On Thu, Aug 13, 2026 at 03:33:58PM +0900, Hajime Tazaki wrote:
> > > Upon a private file mapping request to /dev/zero, it calls
> > > kernel_read() in do_mmap_private(), getting a failure with the message
> > > like: "kernel reads not supported for file /dev/zero", which is because
> > > zero_fops defined in drivers/char/mem.c has both .read and .read_iter
> > > definitions.
> >
> > Do you actually use a no-mmu system?
>
> If you look at Hajime's contributions, you'll see they're far from an AI
> slopper.
>
> https://lore.kernel.org/linux-mm/?q=hajime+tazaki
That's not what I asked at all.
This patch is fixing /dev/zero which was broken in 2020 for these
systems. I think my question was a legit one, I was not casting
aspersions about any slop here in any way.
> > > @@ -869,7 +886,11 @@ static vm_flags_t determine_vm_flags(struct file *file,
> > >
> > > vm_flags = calc_vm_prot_bits(prot, 0) | calc_vm_flag_bits(file, flags);
> > >
> > > - if (!file) {
> > > + /* private and file mapping will be marked anonymous later (do_mmap_private()).
> > > + * and /dev/zero is marked by them at .mmap_prepare,
> > > + * which should be _before_ this point.
> > > + */
> >
> > Wrong coding style for the comment, which is very typical of
> > LLM-generated stuff. Always rewrite the output of these tools to
> > actually be sane.
>
> A lot of humans write comments like this too. Indeed, it used to be
> the preferred style for net/
Yes, but it's not for anything outside of net/
thanks,
greg k-h