Commit 0ddfb62
Al Viro
fix the softlockups in attach_recursive_mnt()
In case when we mounting something on top of a large stack of overmounts,
all of them being peers of each other, we get quadratic time by the
depth of overmount stack. Easily fixed by doing commit_tree() before
reparenting the overmount; simplifies commit_tree() as well - it doesn't
need to skip the already mounted stuff that had been reparented on top
of the new mounts.
Since we are holding mount_lock through both reparenting and call of
commit_tree(), the order does not matter from the mount hash point
of view.
Reported-by: "Lai, Yi" <[email protected]>
Tested-by: "Lai, Yi" <[email protected]>
Reviewed-by: Christian Brauner <[email protected]>
Fixes: 6632068 "copy_tree(): don't link the mounts via mnt_list"
Signed-off-by: Al Viro <[email protected]>1 parent 8742b2d commit 0ddfb62
1 file changed
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1197 | 1197 | | |
1198 | 1198 | | |
1199 | 1199 | | |
1200 | | - | |
1201 | | - | |
1202 | | - | |
1203 | | - | |
| 1200 | + | |
1204 | 1201 | | |
1205 | 1202 | | |
1206 | 1203 | | |
| |||
2704 | 2701 | | |
2705 | 2702 | | |
2706 | 2703 | | |
| 2704 | + | |
2707 | 2705 | | |
2708 | 2706 | | |
2709 | 2707 | | |
| |||
2713 | 2711 | | |
2714 | 2712 | | |
2715 | 2713 | | |
2716 | | - | |
2717 | 2714 | | |
2718 | 2715 | | |
2719 | 2716 | | |
| |||
0 commit comments