Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 13 Mar 2003 13:58:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 13 Mar 2003 13:58:34 -0500 Received: from parcelfarce.linux.theplanet.co.uk ([195.92.249.252]:27561 "EHLO www.linux.org.uk") by vger.kernel.org with ESMTP id ; Thu, 13 Mar 2003 13:58:32 -0500 Date: Thu, 13 Mar 2003 19:09:08 +0000 From: Matthew Wilcox To: Alex Tomas Cc: Andreas Dilger , linux-kernel , ext2-devel@lists.sourceforge.net, Andrew Morton Subject: Re: [Ext2-devel] [PATCH] concurrent block allocation for ext2 against 2.5.64 Message-ID: <20030313190908.GC29631@parcelfarce.linux.theplanet.co.uk> References: <20030313103948.Z12806@schatzie.adilger.int> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1474 Lines: 36 On Thu, Mar 13, 2003 at 09:43:05PM +0300, Alex Tomas wrote: > > fs/attr.c: > if (ia_valid & ATTR_SIZE) { > if (attr->ia_size == inode->i_size) { > if (ia_valid == ATTR_SIZE) > goto out; /* we can skip lock_kernel() */ > } else { > lock_kernel(); > error = vmtruncate(inode, attr->ia_size); > unlock_kernel(); > if (error) > goto out; > } > } > > so, all (!) truncates are serialized This looks like a bug. It should be safe to delete them. Rationale: - Documentation/filesystems/Locking says ->truncate is called without the BKL. - This isn't the only place vmtruncate() is called. Several of the callers do it without the BKL (eg xfs, cifs). - vmtruncate() appears to handle its own locking (mapping->i_shared_sem) Comments? -- "It's not Hollywood. War is real, war is primarily not about defeat or victory, it is about death. I've seen thousands and thousands of dead bodies. Do you think I want to have an academic debate on this subject?" -- Robert Fisk - 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/