Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 2 Feb 2003 18:22:44 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 2 Feb 2003 18:22:44 -0500 Received: from artax.karlin.mff.cuni.cz ([195.113.31.125]:45462 "EHLO artax.karlin.mff.cuni.cz") by vger.kernel.org with ESMTP id ; Sun, 2 Feb 2003 18:22:44 -0500 Date: Mon, 3 Feb 2003 00:32:12 +0100 (CET) From: Mikulas Patocka To: linux-kernel@vger.kernel.org Subject: 2.0, 2.2, 2.4, 2.5: fsync buffer race Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 997 Lines: 33 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/