From 9c618ae6746240728f8a5cd1a43f6ba51db97912 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Tue, 1 Nov 2011 07:06:17 -0700 Subject: [PATCH] --- yaml --- r: 272267 b: refs/heads/master c: f6d90b4f9ce018bff429d6e01ee672de712b8641 h: refs/heads/master i: 272265: 444a923fcf16cf3604b450ad0f5fb66c25098616 272263: e890d01729e9b4c28f88d2a156d17c78970bcb9b v: v3 --- [refs] | 2 +- trunk/fs/sysfs/dir.c | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index aa5d3f2ad2c2..a7942579fe6b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c87d5d594736dd8b56df67e31846c7d7b8c41a8f +refs/heads/master: f6d90b4f9ce018bff429d6e01ee672de712b8641 diff --git a/trunk/fs/sysfs/dir.c b/trunk/fs/sysfs/dir.c index 48ffbdf0d017..7fdf6a7b7436 100644 --- a/trunk/fs/sysfs/dir.c +++ b/trunk/fs/sysfs/dir.c @@ -865,15 +865,13 @@ int sysfs_rename(struct sysfs_dirent *sd, sd->s_name = new_name; } - /* Remove from old parent's list and insert into new parent's list. */ - if (sd->s_parent != new_parent_sd) { - sysfs_unlink_sibling(sd); - sysfs_get(new_parent_sd); - sysfs_put(sd->s_parent); - sd->s_parent = new_parent_sd; - sysfs_link_sibling(sd); - } + /* Move to the appropriate place in the appropriate directories rbtree. */ + sysfs_unlink_sibling(sd); + sysfs_get(new_parent_sd); + sysfs_put(sd->s_parent); sd->s_ns = new_ns; + sd->s_parent = new_parent_sd; + sysfs_link_sibling(sd); error = 0; out: