diff options
author | Igor Mammedov <niallain@gmail.com> | 2008-04-28 19:08:21 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2008-04-28 19:08:21 -0400 |
commit | e9f20d6f03e8df393b001dab6dc5226c2a5daf57 (patch) | |
tree | 73e94fa5e4f83576c97e36187b809c5aad2ade30 /fs/partitions/msdos.c | |
parent | bf62fd887cab230f5952b611bde25e8e15acb454 (diff) | |
parent | e31a94ed371c70855eb30b77c490d6d85dd4da26 (diff) |
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs/partitions/msdos.c')
-rw-r--r-- | fs/partitions/msdos.c | 20 |
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, §); | 425 | data = read_dev_sector(bdev, 0, §); |
@@ -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 | ||