aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sysfs/dir.c')
-rw-r--r--fs/sysfs/dir.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index d88d0fac9fa5..0050fc40e8c9 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -760,6 +760,7 @@ static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry,
760const struct inode_operations sysfs_dir_inode_operations = { 760const struct inode_operations sysfs_dir_inode_operations = {
761 .lookup = sysfs_lookup, 761 .lookup = sysfs_lookup,
762 .setattr = sysfs_setattr, 762 .setattr = sysfs_setattr,
763 .setxattr = sysfs_setxattr,
763}; 764};
764 765
765static void remove_dir(struct sysfs_dirent *sd) 766static void remove_dir(struct sysfs_dirent *sd)
@@ -939,8 +940,10 @@ again:
939 /* Remove from old parent's list and insert into new parent's list. */ 940 /* Remove from old parent's list and insert into new parent's list. */
940 sysfs_unlink_sibling(sd); 941 sysfs_unlink_sibling(sd);
941 sysfs_get(new_parent_sd); 942 sysfs_get(new_parent_sd);
943 drop_nlink(old_parent->d_inode);
942 sysfs_put(sd->s_parent); 944 sysfs_put(sd->s_parent);
943 sd->s_parent = new_parent_sd; 945 sd->s_parent = new_parent_sd;
946 inc_nlink(new_parent->d_inode);
944 sysfs_link_sibling(sd); 947 sysfs_link_sibling(sd);
945 948
946 out_unlock: 949 out_unlock: