Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2551a530 authored by Darrick J. Wong's avatar Darrick J. Wong
Browse files

xfs: explicitly pass buffer size to xfs_corruption_error



Explicitly pass the buffer length to xfs_corruption_error() instead of
assuming XFS_CORRUPTION_DUMP_LEN so that we avoid dumping off the end
of the buffer.

Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent 85ae0109
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1932,7 +1932,8 @@ xfs_btree_lookup(
				if (level != 0 || cur->bc_nlevels != 1) {
					XFS_CORRUPTION_ERROR(__func__,
							XFS_ERRLEVEL_LOW,
							cur->bc_mp, block);
							cur->bc_mp, block,
							sizeof(*block));
					return -EFSCORRUPTED;
				}

+1 −1
Original line number Diff line number Diff line
@@ -306,7 +306,7 @@ xfs_da3_node_read(
			break;
		default:
			XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW,
					tp->t_mountp, info);
					tp->t_mountp, info, sizeof(*info));
			xfs_trans_brelse(tp, *bpp);
			*bpp = NULL;
			return -EFSCORRUPTED;
+3 −2
Original line number Diff line number Diff line
@@ -251,7 +251,8 @@ xfs_dir3_data_check(
	if (!fa)
		return;
	xfs_corruption_error(__func__, XFS_ERRLEVEL_LOW, dp->i_mount,
			bp->b_addr, __FILE__, __LINE__, fa);
			bp->b_addr, BBTOB(bp->b_length), __FILE__, __LINE__,
			fa);
	ASSERT(0);
}
#endif
@@ -1157,7 +1158,7 @@ xfs_dir2_data_use_free(
	return 0;
corrupt:
	xfs_corruption_error(__func__, XFS_ERRLEVEL_LOW, args->dp->i_mount,
			hdr, __FILE__, __LINE__, fa);
			hdr, sizeof(*hdr), __FILE__, __LINE__, fa);
	return -EFSCORRUPTED;
}

+2 −1
Original line number Diff line number Diff line
@@ -81,7 +81,8 @@ xfs_dir3_leaf_check(
	if (!fa)
		return;
	xfs_corruption_error(__func__, XFS_ERRLEVEL_LOW, dp->i_mount,
			bp->b_addr, __FILE__, __LINE__, fa);
			bp->b_addr, BBTOB(bp->b_length), __FILE__, __LINE__,
			fa);
	ASSERT(0);
}
#else
+2 −1
Original line number Diff line number Diff line
@@ -84,7 +84,8 @@ xfs_dir3_leaf_check(
	if (!fa)
		return;
	xfs_corruption_error(__func__, XFS_ERRLEVEL_LOW, dp->i_mount,
			bp->b_addr, __FILE__, __LINE__, fa);
			bp->b_addr, BBTOB(bp->b_length), __FILE__, __LINE__,
			fa);
	ASSERT(0);
}
#else
Loading