[PATCH 8/9] repair: handle remote symlink CRC errors
Christoph Hellwig
hch at infradead.org
Fri Apr 25 01:01:19 CDT 2014
On Thu, Apr 24, 2014 at 03:02:01PM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner at redhat.com>
>
> 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.
More information about the xfs
mailing list