From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 38F5029DFE for ; Mon, 28 Apr 2014 16:05:13 -0500 (CDT) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 2E9B88F804B for ; Mon, 28 Apr 2014 14:05:13 -0700 (PDT) Received: from ipmail04.adl6.internode.on.net (ipmail04.adl6.internode.on.net [150.101.137.141]) by cuda.sgi.com with ESMTP id O9QZVZ0yoqEC7EUT for ; Mon, 28 Apr 2014 14:05:11 -0700 (PDT) Received: from disappointment.disaster.area ([192.168.1.110] helo=disappointment) by dastard with esmtp (Exim 4.80) (envelope-from ) id 1WesjV-000514-LQ for xfs@oss.sgi.com; Tue, 29 Apr 2014 07:05:01 +1000 Received: from dave by disappointment with local (Exim 4.82) (envelope-from ) id 1WesjV-000519-Kh for xfs@oss.sgi.com; Tue, 29 Apr 2014 07:05:01 +1000 From: Dave Chinner Subject: [PATCH 8/9] repair: handle remote symlink CRC errors Date: Tue, 29 Apr 2014 07:04:58 +1000 Message-Id: <1398719099-19194-9-git-send-email-david@fromorbit.com> In-Reply-To: <1398719099-19194-1-git-send-email-david@fromorbit.com> References: <1398719099-19194-1-git-send-email-david@fromorbit.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: xfs@oss.sgi.com From: Dave Chinner We can't really repair broken symlink buffer contents, but we can at least warn about it and correct the CRC error so the symlink is again readable. Signed-off-by: Dave Chinner --- repair/dinode.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/repair/dinode.c b/repair/dinode.c index b086bec..8891e84 100644 --- a/repair/dinode.c +++ b/repair/dinode.c @@ -1254,6 +1254,7 @@ process_symlink_remote( while (pathlen > 0) { int blk_cnt = 1; int byte_cnt; + int badcrc = 0; fsbno = blkmap_get(blkmap, i); if (fsbno == NULLDFSBNO) { @@ -1284,6 +1285,12 @@ _("cannot read inode %" PRIu64 ", file block %d, disk block %" PRIu64 "\n"), lino, i, fsbno); return 1; } + if (bp->b_error == EFSBADCRC) { + do_warn( +_("Bad symlink buffer CRC, block %" PRIu64 ", inode %" PRIu64 ".\n" + "Correcting CRC, but symlink may be bad.\n"), fsbno, lino); + badcrc = 1; + } byte_cnt = XFS_SYMLINK_BUF_SPACE(mp, byte_cnt); byte_cnt = MIN(pathlen, byte_cnt); @@ -1307,7 +1314,10 @@ _("bad symlink header ino %" PRIu64 ", file block %d, disk block %" PRIu64 "\n") offset += byte_cnt; i++; - libxfs_putbuf(bp); + if (badcrc && !no_modify) + libxfs_writebuf(bp, 0); + else + libxfs_putbuf(bp); } return 0; } -- 1.9.0 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs