If a da btree pointer is zero (i.e. the beginning of the fork) report
this as a corrupt tree to the caller instead of telling it that
everything is good. Fixes assertion errors when fuzzing
nbtree[0].before to zero in xfs/394.
[sandeen: tweak comment above change for clarity]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
return 1;
/*
- * Skip directories with a root marked XFS_DIR2_LEAFN_MAGIC
+ * Directories with a root marked XFS_DIR2_LEAFN_MAGIC are corrupt
*/
if (bno == 0) {
- release_da_cursor(mp, &da_cursor, 0);
- return 0;
+ err_release_da_cursor(mp, &da_cursor, 0);
+ return 1;
} else {
/*
* Now pass cursor and bno into leaf-block processing routine.