[Top] [All Lists]

Re: [PATCH 8/9] repair: handle remote symlink CRC errors

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 8/9] repair: handle remote symlink CRC errors
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 24 Apr 2014 23:01:19 -0700
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1398315722-20870-9-git-send-email-david@xxxxxxxxxxxxx>
References: <1398315722-20870-1-git-send-email-david@xxxxxxxxxxxxx> <1398315722-20870-9-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, Apr 24, 2014 at 03:02:01PM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 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.

> +                     do_warn(
> +_("Bad symlink buffer CRC, block %" PRIu64 ", inode %" PRIu64 ".\n"
> +  "Correcting CRC, but symlink may be bad.\n"), fsbno, lino);
> +                     dirty = 1;

Can you use the badcrc variable name here like in a few other places?

> +             if (dirty)
> +                     libxfs_writebuf(bp, 0);
> +             else
> +                     libxfs_putbuf(bp);

This needs a no_modify check.

Hmm, given how often we have this pattern and how easy it is do get
wrong, maybe libxfs_writebuf should do the no_modify check for us can we
can get rid of all this code?  Or maybe at least in a repair_writebuf
wrapper?  Not saying it should go into this series of course.

<Prev in Thread] Current Thread [Next in Thread>