aboutsummaryrefslogtreecommitdiffstats
path: root/fs/isofs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-10-28 18:37:40 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-10-28 18:37:40 -0400
commitf643ff550afbc82a2bc7026f4a6d64427e4fbc99 (patch)
treeeaa69a0a05caae52b7a1919a4fecf9196ab3d02a /fs/isofs
parentd1b72cc6d8cb766c802fdc70a5edc2f0ba8a2b57 (diff)
isofs_cmp(): we'll never see a dentry for . or ..
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/isofs')
-rw-r--r--fs/isofs/namei.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/fs/isofs/namei.c b/fs/isofs/namei.c
index 95295640d9c8..6f6dd0c6429f 100644
--- a/fs/isofs/namei.c
+++ b/fs/isofs/namei.c
@@ -18,23 +18,6 @@ static int
18isofs_cmp(struct dentry *dentry, const char *compare, int dlen) 18isofs_cmp(struct dentry *dentry, const char *compare, int dlen)
19{ 19{
20 struct qstr qstr; 20 struct qstr qstr;
21
22 if (!compare)
23 return 1;
24
25 /* check special "." and ".." files */
26 if (dlen == 1) {
27 /* "." */
28 if (compare[0] == 0) {
29 if (!dentry->d_name.len)
30 return 0;
31 compare = ".";
32 } else if (compare[0] == 1) {
33 compare = "..";
34 dlen = 2;
35 }
36 }
37
38 qstr.name = compare; 21 qstr.name = compare;
39 qstr.len = dlen; 22 qstr.len = dlen;
40 return dentry->d_op->d_compare(NULL, NULL, dentry->d_name.len, dentry->d_name.name, &qstr); 23 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,
146 (!(de->flags[-sbi->s_high_sierra] & 1))) && 129 (!(de->flags[-sbi->s_high_sierra] & 1))) &&
147 (sbi->s_showassoc || 130 (sbi->s_showassoc ||
148 (!(de->flags[-sbi->s_high_sierra] & 4)))) { 131 (!(de->flags[-sbi->s_high_sierra] & 4)))) {
149 match = (isofs_cmp(dentry, dpnt, dlen) == 0); 132 if (dpnt && (dlen > 1 || dpnt[0] > 1))
133 match = (isofs_cmp(dentry, dpnt, dlen) == 0);
150 } 134 }
151 if (match) { 135 if (match) {
152 isofs_normalize_block_and_offset(de, 136 isofs_normalize_block_and_offset(de,