Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 12:12:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7QJCLoZ032345 for ; Tue, 26 Aug 2008 12:12:21 -0700 X-ASG-Debug-ID: 1219778025-652c03110000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7BB483D1124; Tue, 26 Aug 2008 12:13:45 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id kDVF1qr7cVRrzKty; Tue, 26 Aug 2008 12:13:45 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KY3z6-0001e4-Pz; Tue, 26 Aug 2008 19:13:44 +0000 Date: Tue, 26 Aug 2008 15:13:44 -0400 From: Christoph Hellwig To: Barry Naujok Cc: "xfs@oss.sgi.com" X-ASG-Orig-Subj: Re: REVIEW: Fix xfs_check SEGV when encountering an unreadable block Subject: Re: REVIEW: Fix xfs_check SEGV when encountering an unreadable block Message-ID: <20080826191344.GA30481@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1219778025 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.3796 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/8093/Tue Aug 26 09:01:30 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17729 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Mon, Jun 30, 2008 at 11:51:32AM +1000, Barry Naujok wrote: > xfs_check (xfs_db "check" command) internally uses a stack for I/Os > it reads/writes. In the check command, there are a few places where > the I/O stack is pushed, a read is issued and the read fails but > does not pop the stack location back. > > In nested uses of this stack, the caller then accesses this un-popped > block which the data pointer is "NULL" causing a SEGV. > > I've checked all calls to push_cur()/set_cur() to make sure all > failures call pop_cur(). Looks good to me.