Received: with ECARTIS (v1.0.0; list xfs); Tue, 26 Aug 2008 12:30:51 -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.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7QJUhws006794 for ; Tue, 26 Aug 2008 12:30:44 -0700 X-ASG-Debug-ID: 1219779125-75d600390000-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 1D0711A51B4D; Tue, 26 Aug 2008 12:32:05 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id du7HizkeHzPHmkdj; Tue, 26 Aug 2008 12:32:05 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KY4Gr-0004Yo-LA; Tue, 26 Aug 2008 19:32:05 +0000 Date: Tue, 26 Aug 2008 15:32:05 -0400 From: Christoph Hellwig To: Barry Naujok Cc: "xfs@oss.sgi.com" X-ASG-Orig-Subj: Re: REVIEW: xfs_repair fixes for bad directories Subject: Re: REVIEW: xfs_repair fixes for bad directories Message-ID: <20080826193205.GA31105@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: 1219779127 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.3798 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: 17731 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 Tue, Jul 01, 2008 at 06:00:17PM +1000, Barry Naujok wrote: > Two issues have been encounted with xfs_repair and badly corrupted > directories. > > 1. A huge size (inode di_size) can cause malloc which will fail. > Patch dir_size_check.patch checks for a valid directory size > and if it's bad, junks the directory. The di_size for a dir > only counts the data blocks being used, not all the other > associated metadata. This is limited to 32GB by the > XFS_DIR2_LEAF_OFFSET value in XFS. Anything greater than this > must be invalid. As menioned before this one is trivial nad makes sens. > 2. An update a while ago to xfs_repair attempts to fix invalid > ".." entries for subdirectories where there is a valid parent > with the appropriate entry. It was a partial fix that never > did the full job, especially if the subdirectory was short- > form or it has already been processed. > > Patch fix_dir_rebuild_without_dotdot_entry.patch creates a > post-processing queue after the main scan to update any > directories with an invalid ".." entry. Where is the existing attemp? I can't find code doing anything like that removed in the patch. But the actual patch looks good, while I had this mess with the tons of different boolean flags in repair converting these to a more descriptive bitmask should be a different patch. > Both these patches sit on top of the dinode.patch that has been > posted out for review previously. But you didn't get a review for it, did you? Looked over it briefly and it looks good to m. Again the new code is much much mor readable.