Commit 27034e7
mount: fix regression where open_mountpoint failed on readonly fs
If we fail to create temporary directory for doing a clean mount we can
make mount clean reusing the code which enters new mountns to umount
overmounts. As when last process exits mntns all mounts are implicitly
cleaned from children, see in kernel source - sys_exit->do_exit
->exit_task_namespaces->switch_task_namespaces->free_nsproxy
->put_mnt_ns->umount_tree->drop_collected_mounts->umount_tree:
/* Hide the mounts from mnt_mounts */
list_for_each_entry(p, &tmp_list, mnt_list) {
list_del_init(&p->mnt_child);
}
Fixes commit b6cfb1c ("mount: make open_mountpoint handle overmouts
properly")
#520
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Acked-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>1 parent 594c3a4 commit 27034e7
1 file changed
+20
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1325 | 1325 | | |
1326 | 1326 | | |
1327 | 1327 | | |
1328 | | - | |
1329 | | - | |
1330 | | - | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
1331 | 1338 | | |
| 1339 | + | |
1332 | 1340 | | |
1333 | 1341 | | |
1334 | 1342 | | |
| |||
1367 | 1375 | | |
1368 | 1376 | | |
1369 | 1377 | | |
1370 | | - | |
1371 | 1378 | | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
1375 | 1386 | | |
1376 | 1387 | | |
1377 | 1388 | | |
1378 | 1389 | | |
1379 | 1390 | | |
1380 | 1391 | | |
1381 | | - | |
| 1392 | + | |
| 1393 | + | |
1382 | 1394 | | |
1383 | 1395 | | |
1384 | 1396 | | |
| |||
0 commit comments