From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Otte Subject: [BUG] -mm: mm-only-i_size_write-debugging.patch Date: Fri, 20 Oct 2006 14:58:53 +0200 Message-ID: <4538C80D.6060504@de.ibm.com> Reply-To: carsteno@de.ibm.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: linux-fsdevel Return-path: Received: from mtagate2.de.ibm.com ([195.212.29.151]:36802 "EHLO mtagate2.de.ibm.com") by vger.kernel.org with ESMTP id S1423226AbWJTM6y (ORCPT ); Fri, 20 Oct 2006 08:58:54 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.13.8/8.13.8) with ESMTP id k9KCwraV089028 for ; Fri, 20 Oct 2006 12:58:53 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.6/8.13.6/NCO v8.1.1) with ESMTP id k9KD1SCR2511030 for ; Fri, 20 Oct 2006 15:01:28 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k9KCwqLh009413 for ; Fri, 20 Oct 2006 14:58:53 +0200 To: Andrew Morton Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org I think that the warning introduced by the patch mm-only-i_size_write-debugging.patch is incorrect in the case I ran into: [in fs/inode.c] +void i_size_write(struct inode *inode, loff_t i_size) +{ + WARN_ON_ONCE(!mutex_is_locked(&inode->i_mutex)); I can reprocude triggering this warning by copying files to a read+write mounted ext2 filesystem (without -o xip). The stack chain looks like this: BUG: warning at fs/inode.c:1389/i_size_write() Call Trace: ([<0000000000103502>] show_trace+0x166/0x16c) [<00000000001035ce>] show_stack+0xc6/0xf8 [<000000000010362e>] dump_stack+0x2e/0x3c [<00000000001b6484>] i_size_write+0x78/0x84 [<00000000001ca5ce>] generic_commit_write+0x62/0x84 [<00000000002296ec>] ext2_commit_chunk+0x64/0xbc [<0000000000229b70>] ext2_make_empty+0x1e8/0x21c [<000000000022eeb2>] ext2_mkdir+0xea/0x19c [<00000000001a66d8>] vfs_mkdir+0x10c/0x1c4 [<00000000001aa3ac>] sys_mkdirat+0xc8/0x120 [<00000000001aa436>] sys_mkdir+0x32/0x40 [<000000000010dc18>] sysc_tracego+0xe/0x14 [<000002000012a3fa>] 0x2000012a3fa I believe ext2 is save to write without i_mutex here: The inode is newly created by ext2_new_inode, and is not accessible to other contexts at this time. On the other hand, ext2_mkdir could grab the i_mutex of the newly created inode. Any advice would be helpful.