Subject: ADFS patches to add ",xxx" typing

From: Chris Rutter <[email-masked]>
Date: Thu, 11 Nov 1999 11:17:03 +0000 (GMT)

In a fit of desperation (I needed to get an ADFS image looking like
normal ADFS over NFS) I added some code to the 2.2 ADFS stuff to make
it append ",xxx" to indicate file types to files.  I have no idea
whether I've done this well, or optimally, but it does appear to work.

The code hinges around adding the extensions in readdir(), and then
catching look-up of dentry structs with the ",xxx" extension, where
it shaves off the extension before generating the inode.  This way,
accessing both "File" and "File,xxx" works.

It adds an options bitfield to the ADFS superblock, and it turns on
support when it comes across "xxx" in the options.  Hence use
`-o xxx' as a parameter to mount to turn it on.

The patch is at:

  http://www.inkvine.fluff.org/~chris/ftp/linux-2.2.12-adfs-xxx.patch
  ftp.inkvine.fluff.org:/users/chris/linux-2.2.12-adfs-xxx.patch

(It also adds `unsigned' to a couple of chars, which means that the
map-validation code doesn't fail on i386.  However, I still have many
errors about lost fragments and hole-y directories -- perhaps there's
some other porting issue to be addressed in the code.  Anyway, it now
appears to work basically fine on my i386 Linux box.)

Problems:

  * `,' seems to be a valid FileCore leafname character, thus:

  * Files that end with ",xxx" where all `x' are valid hex digits will
    be truncated before a look-up ever gets performed.  The kludge for
    this is to try and access a file called "File,xxx,yyy", where the
    ",yyy" will be stripped off, leaving the look-up routine with the
    original filename.  Normally, of course, you would only access files
    that you see, and so the kludge would happen automatically, but if
    you have a symlink lying around, an you just happened to have mounted
    your image with "xxx" today...

  * Directories aren't masked out in the look-up routine, and so munging
    will (incorrectly) be done; same kludge as above applies.

  * It doesn't cope with un-typed files, but then again, does anyone really
    use them these days?

A possible fix to the first problem would be to prevent further exten-
sion if the file name already ends in a valid ",xxx" contruction,
possibly with the extra clause that the "xxx" must match the file's
type.  This would allow NFS-alike files on ADFS partitions to appear
correctly over NFS.  These files would then need to be flagged as such
in the dentry, or alternatively if the first look-up fails, a second
with the preivously-removed extension could be performed.  This,
however, falls over when a valid file exists.  Consider: `foo', `foo,xxx'
and `foo,xxx,yyy' (the final one being the extended one).

-- 
Chris <[email-masked]>                         ( http://www.fluff.org/chris )

unsubscribe: body of `unsubscribe linux-arm-kernel' to [email-masked]

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Thu, 11 Nov 1999 19:51:39 +0000 (GMT)

> appears to work basically fine on my i386 Linux box.)

Upgrade to 2.2.13.  It's been fixed for several months now.  If you still
get lost fragments and hole-y directories, then check your map.  Also,
don't develop ADFS on 2.2 - it's outdated wrt 2.3 by a long way.  2.3
has preliminary F+ and write support (which it has had it for about 4
months).
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |  http://www.arm.linux.org.uk/~rmk/armlinux.html    /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |