Received: with ECARTIS (v1.0.0; list xfs); Mon, 25 Aug 2008 19:06:09 -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.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m7Q266B1013859 for ; Mon, 25 Aug 2008 19:06:07 -0700 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA13560; Tue, 26 Aug 2008 12:07:27 +1000 Date: Tue, 26 Aug 2008 12:08:27 +1000 To: "Christoph Hellwig" Subject: Re: REVIEW: xfs_repair fixes for bad directories From: "Barry Naujok" Organization: SGI Cc: "xfs@oss.sgi.com" Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <20080701081306.GA11135@infradead.org> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <20080701081306.GA11135@infradead.org> User-Agent: Opera Mail/9.51 (Win32) X-Virus-Scanned: ClamAV 0.91.2/8088/Mon Aug 25 13:49:45 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17719 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Tue, 01 Jul 2008 18:13:06 +1000, Christoph Hellwig wrote: > 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. > > This one looks good. > >> 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. > > For this one I'll need to read the surrounding code first to do > a useful review, so it'll take some time. Ping?