aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/sysfs/dir.c2
1 files changed, 2 insertions, 0 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 */
434again: 436again:
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)) {