aboutsummaryrefslogtreecommitdiffstats
path: root/fs/partitions/check.c
diff options
context:
space:
mode:
authorSuzuki K P <suzuki@in.ibm.com>2006-12-06 23:35:16 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:30 -0500
commit57881dd9df40b76dc7fc6a0d13fd75f337accb32 (patch)
tree088010827c14fbe75628c64848839616175bb9d6 /fs/partitions/check.c
parent5127d002f9769ba6b1691de78dd3a5c14635e183 (diff)
[PATCH] Fix check_partition routines
check_partition() stops its probe once it hits an I/O error from the partition checkers. This would prevent the actual partition checker getting a chance to verify the partition. So this patch lets check_partition() continue probing untill it hits a success while recording the I/O error which might have been reported by the checking routines. Also, it does some cleanup of the partition methods for ibm, atari and amiga to return -1 upon hitting an I/O error. Signed-off-by: Suzuki K P <suzuki@in.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/partitions/check.c')
-rw-r--r--fs/partitions/check.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 0b6113ba3b79..1901137f4eca 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -153,7 +153,7 @@ static struct parsed_partitions *
153check_partition(struct gendisk *hd, struct block_device *bdev) 153check_partition(struct gendisk *hd, struct block_device *bdev)
154{ 154{
155 struct parsed_partitions *state; 155 struct parsed_partitions *state;
156 int i, res; 156 int i, res, err;
157 157
158 state = kmalloc(sizeof(struct parsed_partitions), GFP_KERNEL); 158 state = kmalloc(sizeof(struct parsed_partitions), GFP_KERNEL);
159 if (!state) 159 if (!state)
@@ -165,13 +165,24 @@ check_partition(struct gendisk *hd, struct block_device *bdev)
165 sprintf(state->name, "p"); 165 sprintf(state->name, "p");
166 166
167 state->limit = hd->minors; 167 state->limit = hd->minors;
168 i = res = 0; 168 i = res = err = 0;
169 while (!res && check_part[i]) { 169 while (!res && check_part[i]) {
170 memset(&state->parts, 0, sizeof(state->parts)); 170 memset(&state->parts, 0, sizeof(state->parts));
171 res = check_part[i++](state, bdev); 171 res = check_part[i++](state, bdev);
172 if (res < 0) {
173 /* We have hit an I/O error which we don't report now.
174 * But record it, and let the others do their job.
175 */
176 err = res;
177 res = 0;
178 }
179
172 } 180 }
173 if (res > 0) 181 if (res > 0)
174 return state; 182 return state;
183 if (!err)
184 /* The partition is unrecognized. So report I/O errors if there were any */
185 res = err;
175 if (!res) 186 if (!res)
176 printk(" unknown partition table\n"); 187 printk(" unknown partition table\n");
177 else if (warn_no_part) 188 else if (warn_no_part)