Re: Large folios and filemap_get_folios_contig()

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

 



On Thu, Apr 03, 2025 at 08:06:53PM +1030, Qu Wenruo wrote:
> Recently I hit a bug when developing the large folios support for btrfs.
> 
> That we call filemap_get_folios_contig(), then lock each returned folio.
> (We also have a case where we unlock each returned folio)
> 
> However since a large folio can be returned several times in the batch,
> this obviously makes a deadlock, as btrfs is trying to lock the same
> folio more than once.

Sorry, what?  A large folio should only be returned once.  xas_next()
moves to the next folio.  How is it possible that
filemap_get_folios_contig() returns the same folio more than once?

> Then I looked into the caller of filemap_get_folios_contig() inside
> mm/gup, and it indeed does the correct skip.

... that code looks wrong to me.





[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