diff options
| -rw-r--r-- | fs/configfs/dir.c | 9 | ||||
| -rw-r--r-- | fs/configfs/inode.c | 12 |
2 files changed, 12 insertions, 9 deletions
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index f419519ec41f..214ec14149d9 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c | |||
| @@ -432,14 +432,9 @@ static int configfs_attach_attr(struct configfs_dirent * sd, struct dentry * den | |||
| 432 | (sd->s_type & CONFIGFS_ITEM_BIN_ATTR) ? | 432 | (sd->s_type & CONFIGFS_ITEM_BIN_ATTR) ? |
| 433 | configfs_init_bin_file : | 433 | configfs_init_bin_file : |
| 434 | configfs_init_file); | 434 | configfs_init_file); |
| 435 | if (error) { | 435 | if (error) |
| 436 | configfs_put(sd); | 436 | configfs_put(sd); |
| 437 | return error; | 437 | return error; |
| 438 | } | ||
| 439 | |||
| 440 | d_rehash(dentry); | ||
| 441 | |||
| 442 | return 0; | ||
| 443 | } | 438 | } |
| 444 | 439 | ||
| 445 | static struct dentry * configfs_lookup(struct inode *dir, | 440 | static struct dentry * configfs_lookup(struct inode *dir, |
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c index cee087d8f7e0..45811ea3fd87 100644 --- a/fs/configfs/inode.c +++ b/fs/configfs/inode.c | |||
| @@ -199,9 +199,17 @@ int configfs_create(struct dentry * dentry, umode_t mode, void (*init)(struct in | |||
| 199 | configfs_set_inode_lock_class(sd, inode); | 199 | configfs_set_inode_lock_class(sd, inode); |
| 200 | 200 | ||
| 201 | init(inode); | 201 | init(inode); |
| 202 | d_instantiate(dentry, inode); | 202 | if (S_ISDIR(mode) || S_ISLNK(mode)) { |
| 203 | if (S_ISDIR(mode) || S_ISLNK(mode)) | 203 | /* |
| 204 | * ->symlink(), ->mkdir(), configfs_register_subsystem() or | ||
| 205 | * create_default_group() - already hashed. | ||
| 206 | */ | ||
| 207 | d_instantiate(dentry, inode); | ||
| 204 | dget(dentry); /* pin link and directory dentries in core */ | 208 | dget(dentry); /* pin link and directory dentries in core */ |
| 209 | } else { | ||
| 210 | /* ->lookup() */ | ||
| 211 | d_add(dentry, inode); | ||
| 212 | } | ||
| 205 | return error; | 213 | return error; |
| 206 | } | 214 | } |
| 207 | 215 | ||
