lkml.org 
[lkml]   [1999]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: dcache problems with vfat
Alexander Viro writes:
> All this aliases-related stuff looks ugly. Try
> $ mkdir a.long
> $ cd a~1.lon
> $ mkdir b
> $ cd b
> $ mv ../../a.long .
>
> ... and watch the fun.

Didn't quite get the untested patch to compile. Here is the version
that at least compiles. Don't know if it works although it looks reasonble
to me.

- Gordon

--- fs/vfat/namei.c~ Tue Dec 1 23:52:55 1998
+++ fs/vfat/namei.c Wed Jan 6 01:28:24 1999
@@ -1639,6 +1639,26 @@
return res;
}

+int vfat_equiv(struct dentry *dentry1, struct dentry *dentry2)
+{
+ struct list_head *head, *tmp;
+ struct dentry *alias;
+
+ if (dentry1 == dentry2) return 1;
+
+ head = &dentry1->d_inode->i_dentry;
+ if (dentry1->d_inode) {
+ tmp = dentry1->d_inode->i_dentry.next;
+ while (tmp != head) {
+ alias = list_entry(tmp, struct dentry, d_alias);
+ if (alias == dentry2)
+ return 1;
+ tmp = tmp->next;
+ }
+ }
+ return 0;
+}
+
int vfat_rename(struct inode *old_dir,struct dentry *old_dentry,
struct inode *new_dir,struct dentry *new_dentry)
{
@@ -1690,7 +1710,7 @@
walk = new_dentry;
/* prevent moving directory below itself */
for (;;) {
- if (walk == old_dentry) return -EINVAL;
+ if (vfat_equiv(walk, old_dentry)) return -EINVAL;
if (walk == walk->d_parent) break;
walk = walk->d_parent;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.046 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site