aboutsummaryrefslogtreecommitdiffstats
path: root/fs/partitions
diff options
context:
space:
mode:
Diffstat (limited to 'fs/partitions')
-rw-r--r--fs/partitions/msdos.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c
index 5567ec0d03a3..796511886f28 100644
--- a/fs/partitions/msdos.c
+++ b/fs/partitions/msdos.c
@@ -18,7 +18,7 @@
18 * 18 *
19 * Re-organised Feb 1998 Russell King 19 * Re-organised Feb 1998 Russell King
20 */ 20 */
21 21#include <linux/msdos_fs.h>
22 22
23#include "check.h" 23#include "check.h"
24#include "msdos.h" 24#include "msdos.h"
@@ -419,6 +419,7 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev)
419 Sector sect; 419 Sector sect;
420 unsigned char *data; 420 unsigned char *data;
421 struct partition *p; 421 struct partition *p;
422 struct fat_boot_sector *fb;
422 int slot; 423 int slot;
423 424
424 data = read_dev_sector(bdev, 0, &sect); 425 data = read_dev_sector(bdev, 0, &sect);
@@ -444,8 +445,21 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev)
444 p = (struct partition *) (data + 0x1be); 445 p = (struct partition *) (data + 0x1be);
445 for (slot = 1; slot <= 4; slot++, p++) { 446 for (slot = 1; slot <= 4; slot++, p++) {
446 if (p->boot_ind != 0 && p->boot_ind != 0x80) { 447 if (p->boot_ind != 0 && p->boot_ind != 0x80) {
447 put_dev_sector(sect); 448 /*
448 return 0; 449 * Even without a valid boot inidicator value
450 * its still possible this is valid FAT filesystem
451 * without a partition table.
452 */
453 fb = (struct fat_boot_sector *) data;
454 if (slot == 1 && fb->reserved && fb->fats
455 && fat_valid_media(fb->media)) {
456 printk("\n");
457 put_dev_sector(sect);
458 return 1;
459 } else {
460 put_dev_sector(sect);
461 return 0;
462 }
449 } 463 }
450 } 464 }
451 465