lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD+278W-BG5tNPBJJ=gYwyygrotk+58-OCmv_LfsgHEwSAPEVw@mail.gmail.com>
Date: Tue, 25 Feb 2025 16:57:16 +0530
From: RSINGH <rsingh.ind.1272@...il.com>
To: linux-ext4@...r.kernel.org
Subject: Doubt about race condition between fallocate() and writeback path

Hi!

I had the following doubt related to interaction between fallocate(),
write() and writeback path
Can someone please provide insights?

In ext4_punch_hole(), writeout of dirty pages is done before acquiring
inode lock as shown below:

==========================================
/*
* Write out all dirty pages to avoid race conditions
* Then release them.
*/
if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) {
ret = filemap_write_and_wait_range(mapping, offset,
  offset + length - 1);
if (ret)
return ret;
}

inode_lock(inode);
==========================================

Isn't there a chance that after writing dirty pages and before
acquiring inode lock, more pages can get dirtied while writeback path
is also processing the dirty pages?

Regards,
RS

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ