mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-24 19:40:21 +09:00
vfs: Is mounted should be testing mnt_ns for NULL or error.
commit260a459d2eupstream. A bug was introduced with the is_mounted helper function in commitf7a99c5b7cAuthor: Al Viro <viro@zeniv.linux.org.uk> Date: Sat Jun 9 00:59:08 2012 -0400 get rid of ->mnt_longterm it's enough to set ->mnt_ns of internal vfsmounts to something distinct from all struct mnt_namespace out there; then we can just use the check for ->mnt_ns != NULL in the fast path of mntput_no_expire() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> The intent was to test if the real_mount(vfsmount)->mnt_ns was NULL_OR_ERR but the code is actually testing real_mount(vfsmount) and always returning true. The result is d_absolute_path returning paths it should be hiding. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
This commit is contained in:
committed by
Kamal Mostafa
parent
a367bcc2f7
commit
5ef6719d27
@@ -66,7 +66,7 @@ static inline int mnt_has_parent(struct mount *mnt)
|
||||
static inline int is_mounted(struct vfsmount *mnt)
|
||||
{
|
||||
/* neither detached nor internal? */
|
||||
return !IS_ERR_OR_NULL(real_mount(mnt));
|
||||
return !IS_ERR_OR_NULL(real_mount(mnt)->mnt_ns);
|
||||
}
|
||||
|
||||
extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
|
||||
|
||||
Reference in New Issue
Block a user