From: Matthew Wilcox <willy@infradead.org>
To: Christoph Hellwig <hch@lst.de>
Cc: akpm@linux-foundation.org, jack@suse.cz,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
dhowells@redhat.com, marc.dionne@auristor.com,
linux-afs@lists.infradead.org,
syzbot+48011b86c8ea329af1b9@syzkaller.appspotmail.com
Subject: Re: [PATCH 1/2] filemap: fix the conditional folio_put in filemap_fault
Date: Thu, 4 May 2023 04:34:43 +0100 [thread overview]
Message-ID: <ZFMn0zGC58KtQw6N@casper.infradead.org> (raw)
In-Reply-To: <20230503154936.GA31522@lst.de>
On Wed, May 03, 2023 at 05:49:36PM +0200, Christoph Hellwig wrote:
> On Wed, May 03, 2023 at 04:48:20PM +0100, Matthew Wilcox wrote:
> > > - folio_put(folio);
> >
> > Why not simply:
> >
> > - if (folio)
> > + if (!IS_ERR_OR_NULL(folio))
>
> no need for the OR_NULL.
Right. I didn't read the whole function.
> But I find the extra label way easier to
> reason about, and it's exactly the same amount of code.
If it were easy to reason about, it would have a less ugly name.
next prev parent reply other threads:[~2023-05-04 3:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-03 15:45 Christoph Hellwig
2023-05-03 15:45 ` [PATCH 2/2] afs: fix the afs_dir_get_folio return value Christoph Hellwig
2023-05-03 15:54 ` Jan Kara
2023-05-03 15:48 ` [PATCH 1/2] filemap: fix the conditional folio_put in filemap_fault Matthew Wilcox
2023-05-03 15:49 ` Christoph Hellwig
2023-05-04 3:34 ` Matthew Wilcox [this message]
2023-05-03 15:57 ` Jan Kara
2023-05-03 18:55 ` [PATCH 2/2] afs: fix the afs_dir_get_folio return value David Howells
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=ZFMn0zGC58KtQw6N@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=hch@lst.de \
--cc=jack@suse.cz \
--cc=linux-afs@lists.infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=marc.dionne@auristor.com \
--cc=syzbot+48011b86c8ea329af1b9@syzkaller.appspotmail.com \
/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