diff options
-rw-r--r-- | fs/namespace.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index ed4a3eaac48d..4e9a3de3319c 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -752,6 +752,7 @@ void mntput_no_expire(struct vfsmount *mnt) { int cpu = get_cpu(); put_cpu(); +repeat: if (likely(mnt->mnt_flags & MNT_MOUNTED)) { vfsmount_read_lock(cpu); if (unlikely(!(mnt->mnt_flags & MNT_MOUNTED))) { @@ -766,9 +767,11 @@ void mntput_no_expire(struct vfsmount *mnt) return; } -repeat: vfsmount_write_lock(); - BUG_ON(mnt->mnt_flags & MNT_MOUNTED); + if (unlikely((mnt->mnt_flags & MNT_MOUNTED))) { + vfsmount_write_unlock(); + goto repeat; + } preempt_disable(); dec_mnt_count(mnt); preempt_enable(); @@ -781,7 +784,9 @@ repeat: __mntput(mnt); return; } + preempt_disable(); add_mnt_count(mnt, mnt->mnt_pinned + 1); + preempt_enable(); mnt->mnt_pinned = 0; vfsmount_write_unlock(); acct_auto_close_mnt(mnt); |