From: Philippe De Muyter <phdm@macqel.be>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH vfat] allow retrieving entries with trailing dots
Date: Wed, 10 Mar 2010 13:32:57 +0100 [thread overview]
Message-ID: <20100310123257.GA2899@frolo.macqel> (raw)
Hello Ogawa,
This fixes accessing vfat entries with trailing dots created by an external
vfat driver (like the one in IOMEGA home network hard drives)
Philippe
--
Some vfat-formatted network disks that are also usb disk do not discard
trailing dots when creating files or directories via ftp.
Connecting afterwards this drive via usb to a linux machine leads to the
following problem :
if one issues the `ls' or `find' command, one gets this message :
find: ./Simon_&_Garfunkel-Wednesday_Morning,_3_a.m.: No such file or directory
Fix that by first trying to retrieve the entry with the full name, and only if
that fails and there are trailing dots in the searched name, try then to find
the truncated name.
Signed-off-by: Philippe De Muyter <phdm@macqel.be>
--- 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);
}
next reply other threads:[~2010-03-10 12:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-10 12:32 Philippe De Muyter [this message]
2010-03-10 14:44 ` [PATCH vfat] allow retrieving entries with trailing dots OGAWA Hirofumi
2010-03-10 16:14 ` Philippe De Muyter
2010-03-10 17:16 ` OGAWA Hirofumi
2010-03-10 23:58 ` Philippe De Muyter
2010-03-11 9:26 ` OGAWA Hirofumi
2010-03-11 12:02 ` Philippe De Muyter
2010-03-11 12:41 ` OGAWA Hirofumi
2010-03-13 11:31 ` Philippe De Muyter
2010-03-13 13:06 ` OGAWA Hirofumi
2010-03-14 10:39 ` [PATCH vfat] IOMEGA network drive compatibility Philippe De Muyter
2010-03-14 11:17 ` OGAWA Hirofumi
2010-03-14 14:13 ` Philippe De Muyter
2010-03-14 14:52 ` OGAWA Hirofumi
-- strict thread matches above, loose matches on Subject: below --
2009-03-19 18:11 [PATCH] parport netmos 9845 & 9855 1P4S fixes Philippe De Muyter
2009-03-23 8:50 ` Philippe De Muyter
2009-03-23 14:00 ` Philippe De Muyter
2009-09-25 19:46 ` [PATCH RFC] vfat and Simon_&_Garfunkel-Wednesday_Morning,_3_a.m Philippe De Muyter
2009-09-29 10:05 ` OGAWA Hirofumi
2009-09-29 10:25 ` Philippe De Muyter
2009-09-29 22:43 ` Philippe De Muyter
2009-09-30 11:02 ` OGAWA Hirofumi
2009-09-30 22:19 ` Philippe De Muyter
2009-10-01 10:42 ` OGAWA Hirofumi
2010-02-08 9:39 ` [PATCH vfat] allow retrieving entries with trailing dots Philippe De Muyter
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=20100310123257.GA2899@frolo.macqel \
--to=phdm@macqel.be \
--cc=hirofumi@mail.parknet.co.jp \
--cc=linux-kernel@vger.kernel.org \
/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