Re: [PATCH 2/3] fs/buffer: avoid races with folio migrations on __find_get_block_slow()

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

 



On Thu, Apr 03, 2025 at 03:43:12PM +0200, Jan Kara wrote:
>   fs/ext4/ialloc.c:recently_deleted() - this one is the most problematic
>     place. It must bail rather than sleeping (called under a spinlock) but
>     it depends on the fact that if bh is not returned, then the data has been
>     written out and evicted from memory. Luckily, the usage of
>     recently_deleted() is mostly an optimization to reduce damage in case
>     of crash so rare false failure should be OK. Ted, what is your opinion?

Yes, if we can just assume that inode has not been recently deleted in
the rare case where a miogration is taking place, that should be fine.
So in practice, recently_deleted() could just call some variant of
find_get_block() (with some flag ) which returns NULL if we need to
sleep (e.g., if it is not in the buffer cache so a read would need to
take place, or we need to wait for the page migration to complete),
that should work fine.

Thanks,

					- Ted




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux