← Back to issue list

Be stricter when mounting and safer when umounting

View original Github issue

Metadata

Project
imagecraft
Number
#118
Type
issue
State
closed
Author
upils
Labels
Status: Triaged
Created
Updated
Closed

Current evaluation

Fixed by merged canonical/imagecraft#126 (15871f5): missing mountpoints now fail early, and chroot cleanup attempts every unmount before reporting errors.

Resolution: closed resolved

Reason: The resolving change was merged in canonical/imagecraft#126 at commit 15871f5. It added missing-mountpoint validation and made cleanup collect individual unmount failures while continuing through the mount list.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### What needs to get done - Raise an exception when the mountpoint does not exist in `Mount.mount()` - Catch exceptions when calling `Mount.umount()` in `_cleanup_chroot` to umount as many dirs as possible from the given list. ### Why it needs to get done If the mountpoint given to `Mount` does not exist, nothing is mounted. This may later break the command executed in the chroot. Detecting early that a target cannot be mounted should be easier to manage. When cleaning up the chroot, mounted dirs are unmounted in reverse order. A umounting failure is not caught, so if one umounting fails the current implementation does not try to umount the rest of the list. We should try to left the system in the most clean state so a umounting exception should be caught and raised only after attempting to umount every other mounted dirs.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by merged canonical/imagecraft#126 (15871f5): missing mountpoints now fail early, and chroot cleanup attempts every unmount before reporting errors.
stealth/space-bunny-alpha — closed resolved Merged canonical/imagecraft#126 (commit 15871f5), adding missing-mountpoint validation and ensuring chroot cleanup continues unmounting after individual failures.
qwen/qwen3.6-35b-a3b — — Closed without resolution, likely deferred or abandoned. No pull requests were merged to implement stricter mount validation or safer unmount exception handling.
qwen/qwen3.6-35b-a3b — — Mountpoint validation and unmounting error handling improvements were closed without implementation. No pull request or fix was merged, indicating the changes were abandoned.
qwen/qwen3.6-35b-a3b — — Closed without implementation. The request to validate mountpoints and improve unmount error handling was deferred to internal tracking ticket CRAFT-4402. No code changes or pull requests were merged.
qwen3.6-35b-a3b-mtp-q6 — — Abandoned. The proposed stricter mount validation and safer unmount error handling were not implemented.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/imagecraft#126 (confidence 100%)

    Merged commit 15871f5 implemented both stricter mounting and safer chroot unmounting.

Related issues

Issue Project State Summary Similarity
#126 Be stricter when mounting and safer when umounting imagecraft merged Merged #126 via commit 15871f5, adding missing-mountpoint validation and best-effort unmount cleanup; fixes #118.
83%
#1344 More robust chroot unmounting craft-parts closed Fixed in canonical/craft-parts#1348 (commit aea85f07) by making chroot mounts private before recursively unmounting package-created submounts.
74%
#1348 fix: Make mounted devices private before recursively unmounting the chroot craft-parts merged Merged PR #1348 fixed chroot cleanup by making device mounts private and recursively unmounting package-created submounts; commit aea85f07 closes #1344.
71%