Commit b1983cd8 authored by Al Viro's avatar Al Viro

create_mnt_ns: unidiomatic use of list_add()

while list_add(A, B) and list_add(B, A) are equivalent when both A and B
are guaranteed to be empty, the usual idiom is list_add(what, where),
not the other way round...  Not a bug per se, but only by accident and
it makes RTFS harder for no good reason.
Spotted-by: default avatarRajat Sharma <fs.rajat@gmail.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 61572bb1
...@@ -2463,7 +2463,7 @@ static struct mnt_namespace *create_mnt_ns(struct vfsmount *m) ...@@ -2463,7 +2463,7 @@ static struct mnt_namespace *create_mnt_ns(struct vfsmount *m)
struct mount *mnt = real_mount(m); struct mount *mnt = real_mount(m);
mnt->mnt_ns = new_ns; mnt->mnt_ns = new_ns;
new_ns->root = mnt; new_ns->root = mnt;
list_add(&new_ns->list, &mnt->mnt_list); list_add(&mnt->mnt_list, &new_ns->list);
} else { } else {
mntput(m); mntput(m);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment