linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: dhowells@redhat.com, Christian Brauner <christian@brauner.io>,
	Jeff Layton <jlayton@kernel.org>,
	netfs@lists.linux.dev, v9fs@lists.linux.dev,
	linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org,
	linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] netfs: Fix netfs_page_mkwrite() to check folio->mapping is valid
Date: Mon, 24 Jun 2024 23:40:38 +0100	[thread overview]
Message-ID: <720579.1719268838@warthog.procyon.org.uk> (raw)
In-Reply-To: <ZnmRGyuSZKtmJVhG@casper.infradead.org>

Matthew Wilcox <willy@infradead.org> wrote:

> >  	if (folio_lock_killable(folio) < 0)
> >  		goto out;
> > +	if (folio->mapping != mapping) {
> > +		ret = VM_FAULT_NOPAGE | VM_FAULT_LOCKED;
> > +		goto out;
> > +	}
> 
> Have you tested this?

I've tried to.  generic/247 can trigger it, but the race happens rarely.

> I'd expect it to throw some VM assertions.

I didn't see any.

I guess VM_FAULT_LOCKED is not universally handled by the caller and that I
should unlock the folio myself instead.

David



  parent reply	other threads:[~2024-06-24 22:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-24 11:23 David Howells
2024-06-24 15:30 ` Matthew Wilcox
2024-06-24 22:40 ` David Howells [this message]
2024-06-25 12:29 ` [PATCH v2] " David Howells
2024-06-25 14:54   ` Jeff Layton
2024-06-26 12:19   ` Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=720579.1719268838@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=christian@brauner.io \
    --cc=jlayton@kernel.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=netfs@lists.linux.dev \
    --cc=v9fs@lists.linux.dev \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox