Re: [PATCH] block: integrity: Do not call set_page_dirty_lock()

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

 



On Thu, Apr 17, 2025 at 03:36:43PM +0100, Matthew Wilcox wrote:
> Let's suppose we're allocating the PI buffer in anonymous memory.
> Also, we're under memory pressure.  We've already swapped out the page
> containing the PI buffer once, so it's in the swap cache and marked
> as clean.  We do a READ from the device, and the new metadata is written
> to the page.  Then a new round of memory reclaim happens and this page
> is chosen.  If it's still clean, the new contents will not be written
> to swap and the page will simply be discarded.  When we go to validate
> the PI data, the page will be swapped back in, but it will have old PI
> information in it so the verification will fail.
> 
> What we need to do is mark the folio dirty at pin time.  I believe
> O_DIRECT does this properly, and I'm not sure whether this code does it
> properly or not.

O_DIRECT reads dirty right after pinning and then check if the dirty
bit has been cleared in the I/O completion handler and redirty from a
workqueue if so.  We're currently trying to figure out if we still need
that redirtying with proper pinning.

Either way metadata should follow the data behavior 1:1 here and
preferably also share the code for that as much as possible.





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux