Re: [PATCH] xa_load() needs a NULL check before locking check

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

 



On Wed, Feb 15, 2023 at 09:14:17PM +0800, void0red wrote:
>  	folio = xa_load(&ractl->mapping->i_pages, ractl->_index);
> +	if (!folio) {
> +		VM_BUG_ON(!folio);
> +		return NULL;
> +	}
>  	VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio);

Why does this need to happen?  The caller has inserted all these folios
into the xarray.  They're locked, so they can't be removed.  If they're
not there, something has gone horribly wrong and crashing is a good
response.

>  	ractl->_batch_count = folio_nr_pages(folio);
>  
> -- 
> 2.34.1
> 



[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