Commit
7c4b93d8269b9d35971a8239426b1f6ddc3d5ef7
Exists in
master
and in
39 other branches
8mp-imx_5.4.70_2.3.0, 8qm-imx_5.4.70_2.3.0, emb_imx_lf-5.15.y, emb_lf-6.1.y, imx_3.0.35_4.1.0, imx_3.10.17_1.0.1_ga, imx_3.10.53_1.1.0_ga, imx_3.14.28_1.0.0_ga, imx_4.1.15_1.0.0_ga, pitx_8mp_lf-5.10.y, rt-smarc-imx_4.1.15_1.0.0_ga, rt_linux_5.15.71, smarc-8m-android-11.0.0_2.0.0, smarc-imx6_4.14.98_2.0.0_ga, smarc-imx6_4.9.88_2.0.0_ga, smarc-imx7_4.14.98_2.0.0_ga, smarc-imx7_4.9.11_1.0.0_ga, smarc-imx7_4.9.88_2.0.0_ga, smarc-imx_3.10.53_1.1.0_ga, smarc-imx_3.14.28_1.0.0_ga, smarc-imx_4.1.15_1.0.0_ga, smarc-imx_4.9.11_1.0.0_ga, smarc-imx_4.9.51_imx8m_ga, smarc-imx_4.9.88_2.0.0_ga, smarc-m6.0.1_2.1.0-ga, smarc-n7.1.2_2.0.0-ga, smarc-rel_imx_4.1.15_1.2.0_ga, smarc_8m_00d0_imx_4.14.98_2.0.0_ga, smarc_8m_imx_4.14.78_1.0.0_ga, smarc_8m_imx_4.14.98_2.0.0_ga, smarc_8m_imx_4.19.35_1.1.0, smarc_8mm_imx_4.14.78_1.0.0_ga, smarc_8mm_imx_4.14.98_2.0.0_ga, smarc_8mm_imx_4.19.35_1.1.0, smarc_8mm_imx_5.4.24_2.1.0, smarc_8mp_lf-5.10.y, smarc_8mq_imx_5.4.24_2.1.0, smarc_8mq_lf-5.10.y, smarc_imx_lf-5.15.y
[PATCH] count ghost references to vfsmounts
make propagate_mount_busy() exclude references from the vfsmounts
that had been isolated by umount_tree() and are just waiting for
release_mounts() to dispose of their ->mnt_parent/->mnt_mountpoint.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing
3 changed files
with
6 additions
and
2 deletions
Side-by-side Diff
... |
... |
@@ -548,6 +548,7 @@ |
548
|
548 |
m = mnt->mnt_parent; |
549
|
549 |
mnt->mnt_mountpoint = mnt->mnt_root; |
550
|
550 |
mnt->mnt_parent = mnt; |
|
551 |
+ m->mnt_ghosts--; |
551
|
552 |
spin_unlock(&vfsmount_lock); |
552
|
553 |
dput(dentry); |
553
|
554 |
mntput(m); |
554
|
555 |
|
... |
... |
@@ -572,8 +573,10 @@ |
572
|
573 |
__touch_mnt_namespace(p->mnt_ns); |
573
|
574 |
p->mnt_ns = NULL; |
574
|
575 |
list_del_init(&p->mnt_child); |
575
|
|
- if (p->mnt_parent != p) |
|
576 |
+ if (p->mnt_parent != p) { |
|
577 |
+ p->mnt_parent->mnt_ghosts++; |
576
|
578 |
p->mnt_mountpoint->d_mounted--; |
|
579 |
+ } |
577
|
580 |
change_mnt_propagation(p, MS_PRIVATE); |
578
|
581 |
} |
579
|
582 |
} |
... |
... |
@@ -225,7 +225,7 @@ |
225
|
225 |
*/ |
226
|
226 |
static inline int do_refcount_check(struct vfsmount *mnt, int count) |
227
|
227 |
{ |
228
|
|
- int mycount = atomic_read(&mnt->mnt_count); |
|
228 |
+ int mycount = atomic_read(&mnt->mnt_count) - mnt->mnt_ghosts; |
229
|
229 |
return (mycount > count); |
230
|
230 |
} |
231
|
231 |
|
... |
... |
@@ -61,6 +61,7 @@ |
61
|
61 |
atomic_t mnt_count; |
62
|
62 |
int mnt_expiry_mark; /* true if marked for expiry */ |
63
|
63 |
int mnt_pinned; |
|
64 |
+ int mnt_ghosts; |
64
|
65 |
}; |
65
|
66 |
|
66
|
67 |
static inline struct vfsmount *mntget(struct vfsmount *mnt) |