diff options
Diffstat (limited to 'fs/namespace.c')
-rw-r--r-- | fs/namespace.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index d0244c8ba09c..1766bc9a4e31 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -23,6 +23,7 @@ #include <linux/uaccess.h> #include <linux/proc_ns.h> #include <linux/magic.h> +#include <linux/delay.h> #include "pnode.h" #include "internal.h" @@ -315,8 +316,11 @@ int __mnt_want_write(struct vfsmount *m) * incremented count after it has set MNT_WRITE_HOLD. */ smp_mb(); - while (ACCESS_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD) - cpu_relax(); + while (ACCESS_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD) { + preempt_enable(); + cpu_chill(); + preempt_disable(); + } /* * After the slowpath clears MNT_WRITE_HOLD, mnt_is_readonly will * be set to match its requirements. So we must not load that until @@ -1301,7 +1305,7 @@ static int do_umount(struct mount *mnt, int flags) return retval; } -/* +/* * Is the caller allowed to modify his namespace? */ static inline bool may_mount(void) @@ -1732,7 +1736,7 @@ static int do_loopback(struct path *path, const char *old_name, err = -EINVAL; if (mnt_ns_loop(&old_path)) - goto out; + goto out; mp = lock_mount(path); err = PTR_ERR(mp); |