diff options
author | Suzuki K P <suzuki@in.ibm.com> | 2006-12-06 23:35:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:30 -0500 |
commit | 57881dd9df40b76dc7fc6a0d13fd75f337accb32 (patch) | |
tree | 088010827c14fbe75628c64848839616175bb9d6 /fs/partitions/ibm.c | |
parent | 5127d002f9769ba6b1691de78dd3a5c14635e183 (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/ibm.c')
-rw-r--r-- | fs/partitions/ibm.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/fs/partitions/ibm.c b/fs/partitions/ibm.c index d352a7381fed..9f7ad4244f63 100644 --- a/fs/partitions/ibm.c +++ b/fs/partitions/ibm.c | |||
@@ -43,7 +43,7 @@ cchhb2blk (struct vtoc_cchhb *ptr, struct hd_geometry *geo) { | |||
43 | int | 43 | int |
44 | ibm_partition(struct parsed_partitions *state, struct block_device *bdev) | 44 | ibm_partition(struct parsed_partitions *state, struct block_device *bdev) |
45 | { | 45 | { |
46 | int blocksize, offset, size; | 46 | int blocksize, offset, size,res; |
47 | loff_t i_size; | 47 | loff_t i_size; |
48 | dasd_information_t *info; | 48 | dasd_information_t *info; |
49 | struct hd_geometry *geo; | 49 | struct hd_geometry *geo; |
@@ -56,15 +56,16 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
56 | unsigned char *data; | 56 | unsigned char *data; |
57 | Sector sect; | 57 | Sector sect; |
58 | 58 | ||
59 | res = 0; | ||
59 | blocksize = bdev_hardsect_size(bdev); | 60 | blocksize = bdev_hardsect_size(bdev); |
60 | if (blocksize <= 0) | 61 | if (blocksize <= 0) |
61 | return 0; | 62 | goto out_exit; |
62 | i_size = i_size_read(bdev->bd_inode); | 63 | i_size = i_size_read(bdev->bd_inode); |
63 | if (i_size == 0) | 64 | if (i_size == 0) |
64 | return 0; | 65 | goto out_exit; |
65 | 66 | ||
66 | if ((info = kmalloc(sizeof(dasd_information_t), GFP_KERNEL)) == NULL) | 67 | if ((info = kmalloc(sizeof(dasd_information_t), GFP_KERNEL)) == NULL) |
67 | goto out_noinfo; | 68 | goto out_exit; |
68 | if ((geo = kmalloc(sizeof(struct hd_geometry), GFP_KERNEL)) == NULL) | 69 | if ((geo = kmalloc(sizeof(struct hd_geometry), GFP_KERNEL)) == NULL) |
69 | goto out_nogeo; | 70 | goto out_nogeo; |
70 | if ((label = kmalloc(sizeof(union label_t), GFP_KERNEL)) == NULL) | 71 | if ((label = kmalloc(sizeof(union label_t), GFP_KERNEL)) == NULL) |
@@ -72,7 +73,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
72 | 73 | ||
73 | if (ioctl_by_bdev(bdev, BIODASDINFO, (unsigned long)info) != 0 || | 74 | if (ioctl_by_bdev(bdev, BIODASDINFO, (unsigned long)info) != 0 || |
74 | ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0) | 75 | ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0) |
75 | goto out_noioctl; | 76 | goto out_freeall; |
76 | 77 | ||
77 | /* | 78 | /* |
78 | * Get volume label, extract name and type. | 79 | * Get volume label, extract name and type. |
@@ -92,6 +93,8 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
92 | EBCASC(type, 4); | 93 | EBCASC(type, 4); |
93 | EBCASC(name, 6); | 94 | EBCASC(name, 6); |
94 | 95 | ||
96 | res = 1; | ||
97 | |||
95 | /* | 98 | /* |
96 | * Three different types: CMS1, VOL1 and LNX1/unlabeled | 99 | * Three different types: CMS1, VOL1 and LNX1/unlabeled |
97 | */ | 100 | */ |
@@ -156,6 +159,9 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
156 | counter++; | 159 | counter++; |
157 | blk++; | 160 | blk++; |
158 | } | 161 | } |
162 | if (!data) | ||
163 | /* Are we not supposed to report this ? */ | ||
164 | goto out_readerr; | ||
159 | } else { | 165 | } else { |
160 | /* | 166 | /* |
161 | * Old style LNX1 or unlabeled disk | 167 | * Old style LNX1 or unlabeled disk |
@@ -171,18 +177,17 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
171 | } | 177 | } |
172 | 178 | ||
173 | printk("\n"); | 179 | printk("\n"); |
174 | kfree(label); | 180 | goto out_freeall; |
175 | kfree(geo); | 181 | |
176 | kfree(info); | ||
177 | return 1; | ||
178 | 182 | ||
179 | out_readerr: | 183 | out_readerr: |
180 | out_noioctl: | 184 | res = -1; |
185 | out_freeall: | ||
181 | kfree(label); | 186 | kfree(label); |
182 | out_nolab: | 187 | out_nolab: |
183 | kfree(geo); | 188 | kfree(geo); |
184 | out_nogeo: | 189 | out_nogeo: |
185 | kfree(info); | 190 | kfree(info); |
186 | out_noinfo: | 191 | out_exit: |
187 | return 0; | 192 | return res; |
188 | } | 193 | } |