Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75523
b: refs/heads/master
c: d8c89eb
h: refs/heads/master
i:
  75521: 9a89c4f
  75519: b8e1b9d
v: v3
  • Loading branch information
Linus Torvalds committed Jan 16, 2008
1 parent a1aa4e1 commit 488ee49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 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: fb1dac909d94ff807cd833d340c6827c3a957159
refs/heads/master: d8c89eb3a12f0da96d049bd515c7fa3702e511c5
8 changes: 6 additions & 2 deletions trunk/fs/sysfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,10 @@ static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry,
sd = sysfs_find_dirent(parent_sd, dentry->d_name.name);

/* no such entry */
if (!sd)
if (!sd) {
ret = ERR_PTR(-ENOENT);
goto out_unlock;
}

/* attach dentry and inode */
inode = sysfs_get_inode(sd);
Expand Down Expand Up @@ -781,6 +783,7 @@ int sysfs_rename_dir(struct kobject * kobj, const char *new_name)
old_dentry = sysfs_get_dentry(sd);
if (IS_ERR(old_dentry)) {
error = PTR_ERR(old_dentry);
old_dentry = NULL;
goto out;
}

Expand Down Expand Up @@ -848,13 +851,15 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent_kobj)
old_dentry = sysfs_get_dentry(sd);
if (IS_ERR(old_dentry)) {
error = PTR_ERR(old_dentry);
old_dentry = NULL;
goto out;
}
old_parent = old_dentry->d_parent;

new_parent = sysfs_get_dentry(new_parent_sd);
if (IS_ERR(new_parent)) {
error = PTR_ERR(new_parent);
new_parent = NULL;
goto out;
}

Expand All @@ -878,7 +883,6 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent_kobj)
error = 0;
d_add(new_dentry, NULL);
d_move(old_dentry, new_dentry);
dput(new_dentry);

/* Remove from old parent's list and insert into new parent's list. */
sysfs_unlink_sibling(sd);
Expand Down

0 comments on commit 488ee49

Please sign in to comment.