Skip to content

Commit

Permalink
sysfs: sysfs_delete_link handle symlinks from untagged to tagged dire…
Browse files Browse the repository at this point in the history
…ctories.

This happens for network devices when SYSFS_DEPRECATED is enabled.

Signed-off-by: Eric W. Biederman <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
ebiederm authored and gregkh committed Jul 26, 2010
1 parent 96d6523 commit 521d045
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/sysfs/symlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void sysfs_delete_link(struct kobject *kobj, struct kobject *targ,
{
const void *ns = NULL;
spin_lock(&sysfs_assoc_lock);
if (targ->sd)
if (targ->sd && sysfs_ns_type(kobj->sd))
ns = targ->sd->s_ns;
spin_unlock(&sysfs_assoc_lock);
sysfs_hash_and_remove(kobj->sd, ns, name);
Expand Down

0 comments on commit 521d045

Please sign in to comment.