public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] FAT filesystems and mtools-created filesystems
Date: Sat, 23 Sep 2017 13:42:47 -0400	[thread overview]
Message-ID: <20170923174247.GD30205@bill-the-cat> (raw)
In-Reply-To: <daa2a636-6e9b-dcd3-bc78-d4a8e24494f8@iki.fi>

On Sat, Sep 23, 2017 at 01:26:38PM +0300, Tuomas Tynkkynen wrote:
> Hi,
> 
> FAT file systems created by GNU mtools have a problem that mtools
> doesn't initialize the first cluster field of the '.' and '..'
> directory entries. That is, with the following script:
> 
> mkdir fattmp
> cd fattmp
> mkdir -p foo/bar/baz
> touch foo/bar/baz/biff
> truncate -s 16M ../fattest.img
> mkfs.vfat ../fattest.img
> mcopy -bpsvm -i ../fattest.img ./* ::
> 
> ... `fsck.vfat ../fattest.img` outputs:
> 
> /FOO/BAR/.
>   Start (0) does not point to parent (3)
> /FOO/BAR/..
>   Start (0) does not point to .. (4)
> /FOO/BAR/BAZ/.
>   Start (0) does not point to parent (2)
> /FOO/BAR/BAZ/..
>   Start (0) does not point to .. (3)
> 
> Now that's of course a bug in mtools, but the tricky thing is that
> Linux is fine with that (and probably Windows as well, or they would
> have drowned in complaints), presumably due to both OSes resolving
> '.' and ''..' in their VFS layers.
> 
> I'm not sure if this problem has always been there but I've started
> to see "Invalid FAT entry" prints lately, presumably since the
> "fat/fs: convert to directory iterators" change. In my case it
> accidentally works anyway, since I have an entry like 'LINUX
> ../foo/bar' in extlinux/extlinux.conf and an invalid FAT entry
> somehow makes it back to the root directory.
> 
> So should we
> 
> 1) Ignore the problem and call mtools broken
> 2) Hack around this in the FAT driver
> 3) Special-case '.' and '..' in the common directory traversal code?

Reality triumphs over specification.  Please submit a patch to fix the
new problem.  Bonus points if you can add an fs test for this case to
test/fs/, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170923/cb7b107b/attachment.sig>

      parent reply	other threads:[~2017-09-23 17:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-23 10:26 [U-Boot] FAT filesystems and mtools-created filesystems Tuomas Tynkkynen
2017-09-23 10:51 ` Tuomas Tynkkynen
2017-09-24 20:27   ` Rob Clark
2017-09-23 17:42 ` Tom Rini [this message]

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=20170923174247.GD30205@bill-the-cat \
    --to=trini@konsulko.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