isofs_cmp(): we'll never see a dentry for . or ..
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 28 Oct 2014 22:37:40 +0000 (18:37 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 28 Oct 2014 22:37:40 +0000 (18:37 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/isofs/namei.c

index 95295640d9c8b0a36c4f6fae469e59488c21a52e..6f6dd0c6429f206374fcb6230a4f2f52de56da6a 100644 (file)
@@ -18,23 +18,6 @@ static int
 isofs_cmp(struct dentry *dentry, const char *compare, int dlen)
 {
        struct qstr qstr;
-
-       if (!compare)
-               return 1;
-
-       /* check special "." and ".." files */
-       if (dlen == 1) {
-               /* "." */
-               if (compare[0] == 0) {
-                       if (!dentry->d_name.len)
-                               return 0;
-                       compare = ".";
-               } else if (compare[0] == 1) {
-                       compare = "..";
-                       dlen = 2;
-               }
-       }
-
        qstr.name = compare;
        qstr.len = dlen;
        return dentry->d_op->d_compare(NULL, NULL, dentry->d_name.len, dentry->d_name.name, &qstr);
@@ -146,7 +129,8 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry,
                                (!(de->flags[-sbi->s_high_sierra] & 1))) &&
                        (sbi->s_showassoc ||
                                (!(de->flags[-sbi->s_high_sierra] & 4)))) {
-                       match = (isofs_cmp(dentry, dpnt, dlen) == 0);
+                       if (dpnt && (dlen > 1 || dpnt[0] > 1))
+                               match = (isofs_cmp(dentry, dpnt, dlen) == 0);
                }
                if (match) {
                        isofs_normalize_block_and_offset(de,