hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/fs/namespace.c
....@@ -14,6 +14,7 @@
1414 #include <linux/mnt_namespace.h>
1515 #include <linux/user_namespace.h>
1616 #include <linux/namei.h>
17
+#include <linux/delay.h>
1718 #include <linux/security.h>
1819 #include <linux/cred.h>
1920 #include <linux/idr.h>
....@@ -328,8 +329,11 @@
328329 * incremented count after it has set MNT_WRITE_HOLD.
329330 */
330331 smp_mb();
331
- while (READ_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD)
332
- cpu_relax();
332
+ while (READ_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD) {
333
+ preempt_enable();
334
+ cpu_chill();
335
+ preempt_disable();
336
+ }
333337 /*
334338 * After the slowpath clears MNT_WRITE_HOLD, mnt_is_readonly will
335339 * be set to match its requirements. So we must not load that until