From: Matthew Wilcox <willy@infradead.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: David Howells <dhowells@redhat.com>,
linux-mm@kvack.org, linux-fsdevel@vger.kernel.org
Subject: Re: [bug report] mm: Provide a means of invalidation without using launder_folio
Date: Thu, 13 Jun 2024 16:27:30 +0100 [thread overview]
Message-ID: <ZmsP4hTMHOz3yB2S@casper.infradead.org> (raw)
In-Reply-To: <d0615dd0-1321-4e32-a71f-e1de2921ca7f@moroto.mountain>
On Thu, Jun 13, 2024 at 06:13:19PM +0300, Dan Carpenter wrote:
> On Thu, Jun 13, 2024 at 03:56:23PM +0100, Matthew Wilcox wrote:
> > On Thu, Jun 13, 2024 at 04:55:30PM +0300, Dan Carpenter wrote:
> > > Hello David Howells,
> > >
> > > Commit 74e797d79cf1 ("mm: Provide a means of invalidation without
> > > using launder_folio") from Mar 27, 2024 (linux-next), leads to the
> > > following Smatch static checker warning:
> > >
> > > mm/filemap.c:4229 filemap_invalidate_inode()
> > > error: we previously assumed 'mapping' could be null (see line 4200)
> >
> > I think David has been overly cautious here. I don't think i_mapping
> > can ever be NULL. inode_init_always() sets i_mapping to be
> > &inode->i_data and I don't see anywhere that changes i_mapping to be
> > NULL.
> >
>
> I don't really understand the errors from this function, though... I
> would have expected it to return -EINVAL on this path but it instead
> looks up if any error flags as set in the mapping, otherwise it returns
> success.
Assuming that the '!mapping' check is just a thinko, then it makes
sense. The other two things being tested are (a) Are there no pages
in the mapping? (b) Is the end of the range before the start.
In either case, we have invalidated "all" of the pages in the range
(since there are no pages in the range), so we want to return success.
prev parent reply other threads:[~2024-06-13 15:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <8b6bd8e0-04a2-4b51-9b29-74804ba11564@moroto.mountain>
2024-06-13 14:56 ` [bug report] mm: Provide a means of invalidation without using launder_folio Matthew Wilcox
2024-06-13 15:13 ` Dan Carpenter
2024-06-13 15:27 ` Matthew Wilcox [this message]
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=ZmsP4hTMHOz3yB2S@casper.infradead.org \
--to=willy@infradead.org \
--cc=dan.carpenter@linaro.org \
--cc=dhowells@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).