Commit d33002129eee4717a92e320b0b764a784bbcad3a
Committed by
Greg Kroah-Hartman
1 parent
521d045354
Exists in
master
and in
39 other branches
sysfs: allow creating symlinks from untagged to tagged directories
Supporting symlinks from untagged to tagged directories is reasonable, and needed to support CONFIG_SYSFS_DEPRECATED. So don't fail a prior allowing that case to work. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff
fs/sysfs/symlink.c
... | ... | @@ -67,7 +67,8 @@ |
67 | 67 | |
68 | 68 | sysfs_addrm_start(&acxt, parent_sd); |
69 | 69 | /* Symlinks must be between directories with the same ns_type */ |
70 | - if (ns_type == sysfs_ns_type(sd->s_symlink.target_sd->s_parent)) { | |
70 | + if (!ns_type || | |
71 | + (ns_type == sysfs_ns_type(sd->s_symlink.target_sd->s_parent))) { | |
71 | 72 | if (warn) |
72 | 73 | error = sysfs_add_one(&acxt, sd); |
73 | 74 | else |