@@ -134,6 +134,7 @@
#define xfs_symlink_hdr_ok libxfs_symlink_hdr_ok
#define xfs_verify_cksum libxfs_verify_cksum
+#define xfs_dinode_verify libxfs_dinode_verify
#define xfs_alloc_ag_max_usable libxfs_alloc_ag_max_usable
#define xfs_allocbt_maxrecs libxfs_allocbt_maxrecs
@@ -2448,9 +2448,15 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
* it just in case to ensure that format, etc. are
* set correctly
*/
- if (!no_modify) {
- clear_dinode(mp, dino, lino);
- *dirty += 1;
+ if (libxfs_dinode_verify(mp, lino, dino) != NULL) {
+ do_warn(
+ _("free inode %" PRIu64 " contains errors, "), lino);
+ if (!no_modify) {
+ clear_dinode(mp, dino, lino);
+ do_warn(_("corrected\n"));
+ *dirty += 1;
+ } else
+ do_warn(_("would correct\n"));
}
*used = is_free;
return 0;
xfs_repair checks allocated but unused (free) inodes in on-disk clusters, and up until now silently repairs any errors, and as a result does not alter exit status if errors are found. The in-kernel verifiers will be noisy about these errors and instruct the user to run repair, so it's best if repair is explicit about any fixes it makes. This shamelessly re-uses xfs_dinode_verify for this purpose. Signed-off-by: Eric Sandeen <sandeen@redhat.com> --- -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html