X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=fs%2Fjffs2%2Fdir.c;h=30eb33ff81892586a227a366669c2a133eaadf4a;hb=fd50ecaddf8372a1d96e0daeaac0f93cf04e4d42;hp=84c4bf3631a25b85143856c43b6adcae673b94c4;hpb=631517032f261f6fd35d11321cd2ba695573f2ed;p=cascardo%2Flinux.git diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index 84c4bf3631a2..9b242434adf2 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c @@ -61,10 +61,7 @@ const struct inode_operations jffs2_dir_inode_operations = .get_acl = jffs2_get_acl, .set_acl = jffs2_set_acl, .setattr = jffs2_setattr, - .setxattr = jffs2_setxattr, - .getxattr = jffs2_getxattr, .listxattr = jffs2_listxattr, - .removexattr = jffs2_removexattr }; /***********************************************************************/ @@ -81,6 +78,7 @@ static struct dentry *jffs2_lookup(struct inode *dir_i, struct dentry *target, struct jffs2_full_dirent *fd = NULL, *fd_list; uint32_t ino = 0; struct inode *inode = NULL; + unsigned int nhash; jffs2_dbg(1, "jffs2_lookup()\n"); @@ -89,11 +87,14 @@ static struct dentry *jffs2_lookup(struct inode *dir_i, struct dentry *target, dir_f = JFFS2_INODE_INFO(dir_i); + /* The 'nhash' on the fd_list is not the same as the dentry hash */ + nhash = full_name_hash(NULL, target->d_name.name, target->d_name.len); + mutex_lock(&dir_f->sem); /* NB: The 2.2 backport will need to explicitly check for '.' and '..' here */ - for (fd_list = dir_f->dents; fd_list && fd_list->nhash <= target->d_name.hash; fd_list = fd_list->next) { - if (fd_list->nhash == target->d_name.hash && + for (fd_list = dir_f->dents; fd_list && fd_list->nhash <= nhash; fd_list = fd_list->next) { + if (fd_list->nhash == nhash && (!fd || fd_list->version > fd->version) && strlen(fd_list->name) == target->d_name.len && !strncmp(fd_list->name, target->d_name.name, target->d_name.len)) {