Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226693
b: refs/heads/master
c: fbc8d4c
h: refs/heads/master
i:
  226691: 5aebeff
v: v3
  • Loading branch information
Nick Piggin committed Jan 7, 2011
1 parent c0b6cbe commit f9943d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5adcee1d8d32d7f305f6f5aaefdbf8f35adca177
refs/heads/master: fbc8d4c04626e015b18cc61199f505920abb48f0
17 changes: 9 additions & 8 deletions trunk/fs/configfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,8 @@ int configfs_make_dirent(struct configfs_dirent * parent_sd,

sd->s_mode = mode;
sd->s_dentry = dentry;
if (dentry) {
if (dentry)
dentry->d_fsdata = configfs_get(sd);
dentry->d_op = &configfs_dentry_ops;
}

return 0;
}
Expand Down Expand Up @@ -278,7 +276,6 @@ static int create_dir(struct config_item * k, struct dentry * p,
error = configfs_create(d, mode, init_dir);
if (!error) {
inc_nlink(p->d_inode);
(d)->d_op = &configfs_dentry_ops;
} else {
struct configfs_dirent *sd = d->d_fsdata;
if (sd) {
Expand Down Expand Up @@ -371,9 +368,7 @@ int configfs_create_link(struct configfs_symlink *sl,
CONFIGFS_ITEM_LINK);
if (!err) {
err = configfs_create(dentry, mode, init_symlink);
if (!err)
dentry->d_op = &configfs_dentry_ops;
else {
if (err) {
struct configfs_dirent *sd = dentry->d_fsdata;
if (sd) {
spin_lock(&configfs_dirent_lock);
Expand Down Expand Up @@ -493,7 +488,11 @@ static struct dentry * configfs_lookup(struct inode *dir,
* If it doesn't exist and it isn't a NOT_PINNED item,
* it must be negative.
*/
return simple_lookup(dir, dentry, nd);
if (dentry->d_name.len > NAME_MAX)
return ERR_PTR(-ENAMETOOLONG);
dentry->d_op = &configfs_dentry_ops;
d_add(dentry, NULL);
return NULL;
}

out:
Expand Down Expand Up @@ -685,6 +684,7 @@ static int create_default_group(struct config_group *parent_group,
ret = -ENOMEM;
child = d_alloc(parent, &name);
if (child) {
child->d_op = &configfs_dentry_ops;
d_add(child, NULL);

ret = configfs_attach_group(&parent_group->cg_item,
Expand Down Expand Up @@ -1682,6 +1682,7 @@ int configfs_register_subsystem(struct configfs_subsystem *subsys)
err = -ENOMEM;
dentry = d_alloc(configfs_sb->s_root, &name);
if (dentry) {
dentry->d_op = &configfs_dentry_ops;
d_add(dentry, NULL);

err = configfs_attach_group(sd->s_element, &group->cg_item,
Expand Down

0 comments on commit f9943d4

Please sign in to comment.