Return-Path: Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n3OHqREm094219 for ; Fri, 24 Apr 2009 12:52:27 -0500 Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 391251CE636F for ; Fri, 24 Apr 2009 10:52:25 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id nUsJWjHJOx1kp0bu for ; Fri, 24 Apr 2009 10:52:25 -0700 (PDT) Date: Fri, 24 Apr 2009 13:52:24 -0400 From: Christoph Hellwig Subject: Re: [PATCH] xfs_file_last_byte() needs to acquire ilock Message-ID: <20090424175224.GB32198@infradead.org> References: <1624785772.3251240539480564.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1624785772.3251240539480564.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: xfs-bounces@oss.sgi.com Errors-To: xfs-bounces@oss.sgi.com To: Lachlan McIlroy Cc: xfs@oss.sgi.com On Thu, Apr 23, 2009 at 10:18:00PM -0400, Lachlan McIlroy wrote: > We had some systems crash with this stack: > > [] ia64_leave_kernel+0x0/0x280 > [] xfs_bmbt_get_startoff+0x0/0x20 [xfs] > [] xfs_bmap_last_offset+0x210/0x280 [xfs] > [] xfs_file_last_byte+0x70/0x1a0 [xfs] > [] xfs_itruncate_start+0xc0/0x1a0 [xfs] > [] xfs_inactive_free_eofblocks+0x290/0x460 [xfs] > [] xfs_release+0x1b0/0x240 [xfs] > [] xfs_file_release+0x70/0xa0 [xfs] > [] __fput+0x1a0/0x420 > [] fput+0x40/0x60 > > The problem here is that xfs_file_last_byte() does not acquire the > inode lock and can therefore race with another thread that is modifying > the extext list. While xfs_bmap_last_offset() is trying to lookup > what was the last extent some extents were merged and the extent list > shrunk so the index we lookup is now beyond the end of the extent list > and potentially in a freed buffer. Looks good. Reviewed-by: Christoph Hellwig _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs