while (pathlen > 0) {
int blk_cnt = 1;
int byte_cnt;
+ int badcrc = 0;
fsbno = blkmap_get(blkmap, i);
if (fsbno == NULLDFSBNO) {
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);
offset += byte_cnt;
i++;
- libxfs_putbuf(bp);
+ if (badcrc && !no_modify)
+ libxfs_writebuf(bp, 0);
+ else
+ libxfs_putbuf(bp);
}
return 0;
}