aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2013-02-27 20:05:18 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-27 22:10:21 -0500
commit06004e6eebdaf101a0f9b533fac77b5768d2c09c (patch)
tree5a867e6e20c7fb468ba4d6b7d5501fded8b174f1 /block
parent8b8a6e1881be8d73b7a98f84ccec61e624ec5cac (diff)
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>
Diffstat (limited to 'block')
-rw-r--r--block/partitions/mac.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/block/partitions/mac.c b/block/partitions/mac.c
index 11f688bd76c5..76d8ba6379a9 100644
--- a/block/partitions/mac.c
+++ b/block/partitions/mac.c
@@ -63,6 +63,10 @@ int mac_partition(struct parsed_partitions *state)
63 put_dev_sector(sect); 63 put_dev_sector(sect);
64 return 0; 64 return 0;
65 } 65 }
66
67 if (blocks_in_map >= state->limit)
68 blocks_in_map = state->limit - 1;
69
66 strlcat(state->pp_buf, " [mac]", PAGE_SIZE); 70 strlcat(state->pp_buf, " [mac]", PAGE_SIZE);
67 for (slot = 1; slot <= blocks_in_map; ++slot) { 71 for (slot = 1; slot <= blocks_in_map; ++slot) {
68 int pos = slot * secsize; 72 int pos = slot * secsize;