lkml.org 
[lkml]   [2010]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH vfat] allow retrieving entries with trailing dots
Date
Philippe De Muyter <phdm@macqel.be> writes:

> --- a/fs/fat/namei_vfat.c 2009-09-10 00:13:59.000000000 +0200
> +++ b/fs/fat/namei_vfat.c 2010-02-08 02:28:37.010096903 +0100
> @@ -702,9 +702,22 @@
> static int vfat_find(struct inode *dir, struct qstr *qname,
> struct fat_slot_info *sinfo)
> {
> - unsigned int len = vfat_striptail_len(qname);
> + int err;
> + unsigned int len;
> +
> + /* Some combined ethernet + usb external hard drive do not
> + * remove the trailing dots when creating entries in ethernet mode.
> + * (e.g. Iomega Home Network Hard Drive)
> + * Make accessing those entries possible.
> + */
> + err = fat_search_long(dir, qname->name, qname->len, sinfo);
> + if (!err)
> + return err;
> + len = vfat_striptail_len(qname);
> if (len == 0)
> return -ENOENT;
> + if (len == qname->len)
> + return err;
> return fat_search_long(dir, qname->name, len, sinfo);
> }

This would be bad for both (standard and IO-MEGA hack).

This introduces unneeded directory-parse to standard one. And for
IO-MEGA, this wouldn't provide proper filename handling.

If it wants to handle the tailing-dot as a part of filename, it
shouldn't be able to access to the stripped-dots filename. (For simple
example, I guess you can't do "mv a a." with this patch.)

I'm not still sure if we should include this or not, however, I think
improper/imperfect quick hack wouldn't be acceptable at least.

Thanks.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>


\
 
 \ /
  Last update: 2010-03-10 15:47    [W:0.041 / U:16.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site