Skip to content

Commit

Permalink
isofs_cmp(): we'll never see a dentry for . or ..
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Oct 28, 2014
1 parent d1b72cc commit f643ff5
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions fs/isofs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit f643ff5

Please sign in to comment.