[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180828220427.GA11400@bombadil.infradead.org>
Date: Tue, 28 Aug 2018 15:04:27 -0700
From: Matthew Wilcox <willy@...radead.org>
To: Nicolas Pitre <nicolas.pitre@...aro.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Souptick Joarder <jrdr.linux@...il.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 01/10] cramfs: Convert to use vmf_insert_mixed
On Tue, Aug 28, 2018 at 01:49:25PM -0400, Nicolas Pitre wrote:
> On Tue, 28 Aug 2018, Matthew Wilcox wrote:
> > - ret = vm_insert_mixed(vma, vma->vm_start + off, pfn);
> > + vmf = vmf_insert_mixed(vma, vma->vm_start + off, pfn);
> > + if (vmf & VM_FAULT_ERROR) {
> > + pages = i;
> > + break;
> > + }
>
> I'd suggest this to properly deal with errers instead:
>
> - ret = vm_insert_mixed(vma, vma->vm_start + off, pfn);
> + vmf = vmf_insert_mixed(vma, vma->vm_start + off, pfn);
> + if (vmf & VM_FAULT_ERROR)
> + ret = vm_fault_to_errno(vmf, 0);
By my reading of this function, the intent is actually to return 0
here and allow demand paging to work. Of course, I've spent all of
twenty minutes staring at this function, so I defer to the maintainer.
I think you'd need to be running a make-memory-allocations-fail fuzzer
to hit this, so it's likely never been tested.
Powered by blists - more mailing lists