Skip to contentSkip to conversation

xfs_repair: release corrupt directory node buffer

PATCH In review Darrick J. Wong 3 participants 3 messages Sep 4, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs_repair: release corrupt directory node buffer

If repair encounters a dir node block that fails checksum or verification, free the buffer before the directory gets rebuilt.

---
 repair/dir2.c |    1 +
 1 file changed, 1 insertion(+)
repair/dir2.c +1 -0
index a5646f8..54c49eb 100644
@@ -200,6 +200,7 @@ _("bad dir magic number 0x%x in inode %" PRIu64 " bno = %u\n"),
 		}
 		/* corrupt node; rebuild the dir. */
 		if (bp->b_error == -EFSBADCRC || bp->b_error == -EFSCORRUPTED) {
+			libxfs_putbuf(bp);
 			do_warn(
 _("corrupt tree block %u for directory inode %" PRIu64 "\n"),
 				bno, da_cursor->ino);

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Darrick J. Wong

If repair encounters a dir node block that fails checksum or verification, free the buffer before the directory gets rebuilt.

Quoted 17 lines
---
 repair/dir2.c |    1 +
 1 file changed, 1 insertion(+)
repair/dir2.c +1 -0
index a5646f8..54c49eb 100644
@@ -200,6 +200,7 @@ _("bad dir magic number 0x%x in inode %" PRIu64 " bno = %u\n"),
 		}
 		/* corrupt node; rebuild the dir. */
 		if (bp->b_error == -EFSBADCRC || bp->b_error == -EFSCORRUPTED) {
+			libxfs_putbuf(bp);
 			do_warn(
 _("corrupt tree block %u for directory inode %" PRIu64 "\n"),
 				bno, da_cursor->ino);
Quoted 5 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#2 lore raw
In reply to Darrick J. Wong
Quoted 9 lines · Darrick J. Wong

If repair encounters a dir node block that fails checksum or verification, free the buffer before the directory gets rebuilt.

---
 repair/dir2.c |    1 +
 1 file changed, 1 insertion(+)

Makes sense.

Quoted 17 lines
repair/dir2.c +1 -0
index a5646f8..54c49eb 100644
@@ -200,6 +200,7 @@ _("bad dir magic number 0x%x in inode %" PRIu64 " bno = %u\n"),
 		}
 		/* corrupt node; rebuild the dir. */
 		if (bp->b_error == -EFSBADCRC || bp->b_error == -EFSCORRUPTED) {
+			libxfs_putbuf(bp);
 			do_warn(
 _("corrupt tree block %u for directory inode %" PRIu64 "\n"),
 				bno, da_cursor->ino);

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Signature · 6 lines
Carlos

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs