lkml.org 
[lkml]   [2009]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] Added CONFIG_VFAT_FS_DUALNAMES option

    > When VFAT_FS_DUALNAMES is disabled we avoid the creation of 8.3 short
    > filenames for files on VFAT filesystems that require a long name. The
    > patch uses a pattern of 11 bytes in the directory entry which contains
    > invalid characters such that it cannot be considered to be a valid short
    > filename.
    >
    > Signed-off-by: Andrew Tridgell <tridge@samba.org>
    > Acked-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
    > Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    > ---
    > fs/fat/Kconfig | 20 +++++++++++++++++
    > fs/fat/dir.c | 15 ++++++-------
    > fs/fat/namei_vfat.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++
    > 3 files changed, 86 insertions(+), 8 deletions(-)
    >
    > diff --git a/fs/fat/Kconfig b/fs/fat/Kconfig
    > index 182f9ff..907a5de 100644
    > --- a/fs/fat/Kconfig
    > +++ b/fs/fat/Kconfig
    > @@ -74,6 +74,26 @@ config VFAT_FS
    > To compile this as a module, choose M here: the module will be called
    > vfat.
    >
    > +config VFAT_FS_DUALNAMES
    > + bool "VFAT dual names support"
    > + depends on VFAT_FS


    Defaults should be back-compatible.

    > +
    > + Users considering enabling this option should consider the implications
    > + of any patents that may exist on dual filenames in VFAT.
    > +
    > + If unsure, say N

    Say Y.

    Users considering disabling this should understand that filesystem
    they write to will not be valid vfat filesystems, and may trigger bugs
    in some devices.

    > +#ifndef CONFIG_VFAT_FS_DUALNAMES
    > +/*
    > + * build a 11 byte 8.3 buffer which is not a short filename. We want 11
    > + * bytes which:
    > + * - will be seen as a constant string to all APIs on Linux and Windows
    > + * - cannot be matched with wildcard patterns
    > + * - cannot be used to access the file
    > + * - has a low probability of collision within a directory
    > + * - has an invalid 3 byte extension
    > + * - contains at least one non-space and non-nul byte
    > + */

    What happens on collision? With 60000 entries in directory, there will
    be 50% chance of collision. BAD.

    Why not use something like position in directory instead of random
    number?
    Pavel
    --
    (english) http://www.livejournal.com/~pavelmachek
    (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


    \
     
     \ /
      Last update: 2009-07-01 11:03    [W:0.037 / U:30.292 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site