From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-Boot, 2/2] disk: part_dos: don't claim whole-disk FAT filesystems
Date: Mon, 8 Oct 2012 11:47:36 -0700 [thread overview]
Message-ID: <20121008184736.GD18891@bill-the-cat> (raw)
In-Reply-To: <1349479060-3211-2-git-send-email-swarren@wwwdotorg.org>
On Fri, Oct 05, 2012 at 01:17:40PM -0000, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Logically, a disk that contains a raw FAT filesystem does not in fact
> have a partition table. However, test_part_dos() was claiming that such
> disks did in fact have a DOS-style partition table. This caused
> get_device_and_partition() not to return a whole-disk disk_partition_t,
> since part_type != PART_TYPE_UNKNOWN.
>
> part_dos.c's print_partition_extended() detected the raw FAT filesystem
> condition and printed a fake partition table that encompassed the whole
> disk.
>
> However, part_dos.c's get_partition_info_extended() did not return any
> valid partitions in this case. This combination caused
> get_device_and_partition() not to find any valid partitions, and hence
> to return an error.
>
> Fix test_part_dos() not to claim that raw FAT filesystems are DOS
> partition tables. In turn, this causes get_device_and_partition() to
> return a whole-disk disk_partition_t, and hence the following commands
> work:
>
> fatls mmc 0 /
> fatls mmc 0:auto /
>
> An alternative would be to modify print_partition_extended() to detect
> raw FAT filesystems, just like print_partition_extended() does, and to
> return a fake partition in this case. However, this seems logically
> incorrect, and also duplicates code, since get_device_and_partition()
> falls back to returning a whole-disk partition when there is no partition
> table on the device.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121008/cdc79a84/attachment.pgp>
next prev parent reply other threads:[~2012-10-08 18:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Tom Rini [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121008184736.GD18891@bill-the-cat \
--to=trini@ti.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox