lkml.org 
[lkml]   [2023]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] mm/memory: convert do_page_mkwrite() to use folios
On Sun, Jul 02, 2023 at 10:58:47PM -0700, Sidhartha Kumar wrote:
> @@ -2947,14 +2947,14 @@ static vm_fault_t do_page_mkwrite(struct vm_fault *vmf)
> if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE)))
> return ret;
> if (unlikely(!(ret & VM_FAULT_LOCKED))) {
> - lock_page(page);
> - if (!page->mapping) {
> - unlock_page(page);
> + folio_lock(folio);
> + if (!folio_mapping(folio)) {

You don't need to call folio_mapping() here. folio->mapping works
absolutely fine in this circumstance. In fact, you may have broken a
driver with this change. I can elaborate more, but I'm not quite in the
mood to do that right now.

\
 
 \ /
  Last update: 2023-07-04 01:26    [W:0.076 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site