Skip to content

Commit 06004e6

Browse files
Ming Leitorvalds
authored andcommitted
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: Ming Lei <ming.lei@canonical.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8b8a6e1 commit 06004e6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎block/partitions/mac.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ int mac_partition(struct parsed_partitions *state)
6363
put_dev_sector(sect);
6464
return 0;
6565
}
66+
67+
if (blocks_in_map >= state->limit)
68+
blocks_in_map = state->limit - 1;
69+
6670
strlcat(state->pp_buf, " [mac]", PAGE_SIZE);
6771
for (slot = 1; slot <= blocks_in_map; ++slot) {
6872
int pos = slot * secsize;

0 commit comments

Comments
 (0)