Skip to content

Commit cb5da05

Browse files
Eric Biggersgregkh
authored andcommitted
dm-verity-fec: fix the size of dm_verity_fec_io::erasures
commit a7fca32 upstream. At most 25 entries in dm_verity_fec_io::erasures are used: the maximum number of FEC roots plus one. Therefore, set the array size accordingly. This reduces the size of dm_verity_fec_io by 912 bytes. Note: a later commit introduces a constant DM_VERITY_FEC_MAX_ROOTS, which allows the size to be more clearly expressed as DM_VERITY_FEC_MAX_ROOTS + 1. This commit just fixes the size first. Fixes: a739ff3 ("dm verity: add support for forward error correction") Cc: stable@vger.kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3d1b4e2 commit cb5da05

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/md/dm-verity-fec.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ struct dm_verity_fec {
4747
/* per-bio data */
4848
struct dm_verity_fec_io {
4949
struct rs_control *rs; /* Reed-Solomon state */
50-
int erasures[DM_VERITY_FEC_MAX_RSN]; /* erasures for decode_rs8 */
50+
/* erasures for decode_rs8 */
51+
int erasures[DM_VERITY_FEC_RSM - DM_VERITY_FEC_MIN_RSN + 1];
5152
u8 *output; /* buffer for corrected output */
5253
unsigned int level; /* recursion level */
5354
unsigned int nbufs; /* number of buffers allocated */

0 commit comments

Comments
 (0)