public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.0, 2.2, 2.4, 2.5: fsync buffer race
@ 2003-02-02 23:32 Mikulas Patocka
  2003-02-03  0:00 ` Andrew Morton
  0 siblings, 1 reply; 16+ messages in thread
From: Mikulas Patocka @ 2003-02-02 23:32 UTC (permalink / raw)
  To: linux-kernel

Hi

there's a race condition in filesystem

let's have a two inodes that are placed in the same buffer.

call fsync on inode 1
it goes down to ext2_update_inode [update == 1]
it calls ll_rw_block at the end
ll_rw_block starts to write buffer
ext2_update_inode waits on buffer

while the buffer is writing, another process calls fsync on inode 2
it goes again to ext2_update_inode
it calls ll_rw_block
ll_rw_block sees buffer locked and exits immediatelly
ext2_update_inode waits for buffer
the first write finished, ext2_update_inode exits and changes made by
second proces to inode 2 ARE NOT WRITTEN TO DISK.

This bug causes that when you simultaneously fsync two inodes in the same
buffer, only the first will be really written to disk.

Mikulas





^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2003-03-14  6:32 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-02 23:32 2.0, 2.2, 2.4, 2.5: fsync buffer race Mikulas Patocka
2003-02-03  0:00 ` Andrew Morton
2003-02-03  1:13   ` Mikulas Patocka
2003-02-03  1:20     ` Andrew Morton
2003-02-03  9:29       ` Mikulas Patocka
2003-02-04 23:16   ` Pavel Machek
2003-02-05 15:13     ` Mikulas Patocka
2003-02-10 13:07     ` Andrea Arcangeli
2003-02-10 16:28       ` Mikulas Patocka
2003-02-10 16:57         ` Linus Torvalds
2003-02-10 20:40           ` Andrew Morton
2003-02-10 21:18             ` Andrea Arcangeli
2003-02-10 21:44               ` Andrew Morton
2003-02-10 21:59                 ` Andrea Arcangeli
2003-03-11 13:58                   ` Andrea Arcangeli
2003-03-14  6:42                     ` Andrea Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox