Commit 06004e6e authored by Ming Lei's avatar Ming Lei Committed by Linus Torvalds
Browse files

block/partitions/mac.c: obey the state->limit constraint

It isn't necessary to read the information of partitions whose number is
equal and more than state->limit since only maximum state->limit
partitions will be added inside rescan_partitions().

That is also what other kind of partitions are doing.
Signed-off-by: default avatarMing Lei <>
Cc: Jens Axboe <>
Cc: Yasuaki Ishimatsu <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 8b8a6e18
......@@ -63,6 +63,10 @@ int mac_partition(struct parsed_partitions *state)
return 0;
if (blocks_in_map >= state->limit)
blocks_in_map = state->limit - 1;
strlcat(state->pp_buf, " [mac]", PAGE_SIZE);
for (slot = 1; slot <= blocks_in_map; ++slot) {
int pos = slot * secsize;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment