Re: [PATCH 1/2] filemap: fix the conditional folio_put in filemap_fault

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux