diff options
Diffstat (limited to 'fs/sysfs')
-rw-r--r-- | fs/sysfs/dir.c | 2 | ||||
-rw-r--r-- | fs/sysfs/inode.c | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index 8813990304fe..85a668680f82 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c | |||
@@ -431,6 +431,8 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent) | |||
431 | new_parent_dentry = new_parent ? | 431 | new_parent_dentry = new_parent ? |
432 | new_parent->dentry : sysfs_mount->mnt_sb->s_root; | 432 | new_parent->dentry : sysfs_mount->mnt_sb->s_root; |
433 | 433 | ||
434 | if (old_parent_dentry->d_inode == new_parent_dentry->d_inode) | ||
435 | return 0; /* nothing to move */ | ||
434 | again: | 436 | again: |
435 | mutex_lock(&old_parent_dentry->d_inode->i_mutex); | 437 | mutex_lock(&old_parent_dentry->d_inode->i_mutex); |
436 | if (!mutex_trylock(&new_parent_dentry->d_inode->i_mutex)) { | 438 | if (!mutex_trylock(&new_parent_dentry->d_inode->i_mutex)) { |
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index dd1344b007f5..ccb7d722c558 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
@@ -227,11 +227,8 @@ static inline void orphan_all_buffers(struct inode *node) | |||
227 | 227 | ||
228 | mutex_lock_nested(&node->i_mutex, I_MUTEX_CHILD); | 228 | mutex_lock_nested(&node->i_mutex, I_MUTEX_CHILD); |
229 | if (node->i_private) { | 229 | if (node->i_private) { |
230 | list_for_each_entry(buf, &set->associates, associates) { | 230 | list_for_each_entry(buf, &set->associates, associates) |
231 | down(&buf->sem); | ||
232 | buf->orphaned = 1; | 231 | buf->orphaned = 1; |
233 | up(&buf->sem); | ||
234 | } | ||
235 | } | 232 | } |
236 | mutex_unlock(&node->i_mutex); | 233 | mutex_unlock(&node->i_mutex); |
237 | } | 234 | } |