public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] FAT: check for partition 0 not 1 for whole-disk fs
@ 2012-10-05 23:17 Stephen Warren
  2012-10-05 23:17 ` [U-Boot] [PATCH 2/2] disk: part_dos: don't claim whole-disk FAT filesystems Stephen Warren
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Stephen Warren @ 2012-10-05 23:17 UTC (permalink / raw)
  To: u-boot

From: Stephen Warren <swarren@nvidia.com>

The recent switch to use get_device_and_partition() from do_fat_ls()
broke the ability to access a FAT filesystem directly on a whole device;
FAT only works within a partition on a device.

This change makes e.g. "fatls mmc 0:0" work; explicitly requesting
partition ID 0 is something that get_device_and_partition() fully
supports. However, fat_register_device() expects partition ID 1 to be
used in the full-disk case; partition ID 1 was previously implicitly
specified when the user didn't actually specify a partition ID. Update
fat_register_device() to expect the correct ID.

This change does imply that if a user explicitly executes "fatls mmc 0:1"
then this will fail, and may be a change in behaviour.

Note that this still prevents "fatls mmc 0:auto" from working. The next
patch will fix that.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
Tom, this series is really a bug-fix and should go in before the 9-long
series I posted earlier today. I'll need to rebase that other series on
top of this and repost, once any comments are addressed.
---
 fs/fat/fat.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 41ae15e..80156c8 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -85,7 +85,7 @@ int fat_register_device(block_dev_desc_t * dev_desc, int part_no)
 
 	/* Otherwise it might be a superfloppy (whole-disk FAT filesystem) */
 	if (!cur_dev) {
-		if (part_no != 1) {
+		if (part_no != 0) {
 			printf("** Partition %d not valid on device %d **\n",
 					part_no, dev_desc->dev);
 			return -1;
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-10-08 18:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-05 23:17 [U-Boot] [PATCH 1/2] FAT: check for partition 0 not 1 for whole-disk fs Stephen Warren
2012-10-05 23:17 ` [U-Boot] [PATCH 2/2] disk: part_dos: don't claim whole-disk FAT filesystems Stephen Warren
2012-10-08 18:47   ` [U-Boot] [U-Boot, " Tom Rini
2012-10-05 23:27 ` [U-Boot] [PATCH 1/2] FAT: check for partition 0 not 1 for whole-disk fs Tom Rini
2012-10-05 23:36   ` Stephen Warren
2012-10-05 23:39     ` Tom Rini
2012-10-05 23:46       ` Stephen Warren
2012-10-08 18:47 ` [U-Boot] [U-Boot, " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox