summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-07-19 13:44:27 (GMT)
committerEmil Medve <Emilian.Medve@Freescale.com>2013-04-30 08:17:19 (GMT)
commit0c577d12cd3c98517fd06e1fd5778a485e1f2acf (patch)
tree3a50e022f18598d0ade72c0c7e290b3f8685722f
parent27bcea12186fc98629b3bfab800f05a9114b4e5b (diff)
downloadlinux-fsl-qoriq-0c577d12cd3c98517fd06e1fd5778a485e1f2acf.tar.xz
fs: namespace preemption fix
On RT we cannot loop with preemption disabled here as mnt_make_readonly() might have been preempted. We can safely enable preemption while waiting for MNT_WRITE_HOLD to be cleared. Safe on !RT as well. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--fs/namespace.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 5dd7709..c03d460 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -313,8 +313,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)
+ while (ACCESS_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD) {
+ preempt_enable();
cpu_relax();
+ 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