summaryrefslogtreecommitdiffstats
path: root/fs/vfat/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/vfat/namei.c')
-rw-r--r--fs/vfat/namei.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/vfat/namei.c b/fs/vfat/namei.c
index bdd37df13..be37113d5 100644
--- a/fs/vfat/namei.c
+++ b/fs/vfat/namei.c
@@ -1105,6 +1105,9 @@ static int vfat_find(struct inode *dir,struct qstr* qname,
fil.f_pos = 0;
vf.name = qname->name;
vf.len = qname->len;
+ while (vf.len && vf.name[vf.len-1] == '.') {
+ vf.len--;
+ }
vf.new_filename = new_filename;
vf.found = 0;
vf.posix = MSDOS_SB(sb)->options.posixfs;
@@ -1135,7 +1138,7 @@ static int vfat_find(struct inode *dir,struct qstr* qname,
goto cleanup;
}
- res = vfat_build_slots(dir, qname->name, qname->len, ds,
+ res = vfat_build_slots(dir, qname->name, vf.len, ds,
&slots, &is_long);
if (res < 0) goto cleanup;
@@ -1768,6 +1771,8 @@ int vfat_rename(struct inode *old_dir,struct dentry *old_dentry,
MSDOS_I(new_inode)->i_logstart = MSDOS_I(old_inode)->i_logstart;
MSDOS_I(new_inode)->i_attrs = MSDOS_I(old_inode)->i_attrs;
+ old_inode->i_nlink = 0;
+
fat_cache_inval_inode(old_inode);
mark_inode_dirty(new_inode);