Re: [RFC PATCH 3/6] mm: nommu: fix an issue on map request to /dev/zero
Matthew Wilcox <[email protected]>
| Newsgroups | org.kvack.linux-mm,org.kernel.vger.linux-fsdevel |
|---|---|
| Message-ID | <[email protected]> |
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
> > @@ -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/