Skip to content

overlay-parent-xxx temporary directories lacking cleanup #3939

@dtrudg

Description

@dtrudg

Version of Singularity

main / 4.3

Describe the bug

In i/p/util/fs/overlay/overlay_item_linux.go, the GetParentDir() function creates a temporary "overlay-parent-xxx" directory if no parentDir is set for an overlay.Item.

There is no cleanup function returned, and code that mounts an overlay.Set can therefore leave an empty temporary parent directory in TMPDIR under certain conditions.

This can be seen by running the overlay tests. In practice, SetParentDir is always called when an overlay item is created in normal Singularity flows - so there is no automatic parent directory creation.

drwx------.  2 root     root       40 Jan  8 10:26 overlay-parent-1066510665
drwx------.  2 root     root       40 Jan  8 10:26 overlay-parent-1107244498
drwx------.  3 root     root       60 Jan  8 10:26 overlay-parent-1498204585
drwx------.  2 root     root       40 Jan  8 10:26 overlay-parent-1631351219
drwx------.  2 root     root       40 Jan  8 10:26 overlay-parent-1989129866
drwx------.  2 root     root       40 Jan  8 10:26 overlay-parent-2190074837
drwx------.  2 root     root       40 Jan  8 10:26 overlay-parent-2555208089
drwx------.  2 root     root       40 Jan  8 10:26 overlay-parent-3221074879
drwx------.  2 root     root       40 Jan  8 10:26 overlay-parent-3609591792
drwx------.  2 root     root       40 Jan  8 10:26 overlay-parent-4157154969
drwx------.  2 root     root       40 Jan  8 10:26 overlay-parent-940665531

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions