Re: [PATCH 1/3] btrfs: Convert test_find_delalloc() to use a folio

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

 



On Thu, Jun 19, 2025 at 03:50:01AM +0100, Matthew Wilcox wrote:
> On Fri, Jun 13, 2025 at 08:07:00PM +0100, Matthew Wilcox (Oracle) wrote:
> > @@ -201,17 +200,16 @@ static int test_find_delalloc(u32 sectorsize, u32 nodesize)
> >  	 *           |--- search ---|
> >  	 */
> >  	test_start = SZ_64M;
> > -	locked_page = find_lock_page(inode->i_mapping,
> > +	locked_folio = filemap_lock_folio(inode->i_mapping,
> >  				     test_start >> PAGE_SHIFT);
> > -	if (!locked_page) {
> > -		test_err("couldn't find the locked page");
> > +	if (!locked_folio) {
> > +		test_err("couldn't find the locked folio");
> >  		goto out_bits;
> >  	}
> >  	btrfs_set_extent_bit(tmp, sectorsize, max_bytes - 1, EXTENT_DELALLOC, NULL);
> >  	start = test_start;
> >  	end = start + PAGE_SIZE - 1;
> > -	found = find_lock_delalloc_range(inode, page_folio(locked_page), &start,
> > -					 &end);
> > +	found = find_lock_delalloc_range(inode, locked_folio, &start, &end);
> >  	if (!found) {
> >  		test_err("couldn't find delalloc in our range");
> >  		goto out_bits;
> 
> Hm.  How much do you test the failure paths here?  It seems to me that
> the 'locked_folio' is still locked at this point ...

I think we don't paid too much attention to the failure paths of tests,
it means one has to go to check the new code first. If the tests pass
then they will clean up everything, in case of error it's usually
followed by reboot.




[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