Unable to delete Dataset on 25.04.1

I don’t understand how it could interfere with datasets you literally just created otherwise.

It’s not that odd. We use procfs to discover processes that currently have files open within datasets. Having root be unable to stat a file is unexpected. stat is used to determine whether the open fd by a process is a regular file or directory and whether it’s located in a dataset that’s being deleted or whatever. This then allows us to say “we can’t do this because is using the dataset”.

Okay, so it’s not interfering with the place (/mnt/tank or /dev), but rather the method (stat)?

Look at original traceback:

  File "/usr/lib/python3/dist-packages/middlewared/plugins/pool_/dataset_processes.py", line 173, in processes_using_paths
    (include_devs and os.stat(fd).st_dev in include_devs) or
                      ^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/proc/9861/fd/10'

Root in host is being denied ability to stat the open file or basically get any info about it. Just spitballing, but my guess is that the file is in an isolated mount namespace.

From this and this, yes, snap packages utilise mount namespaces to isolate the filesystem view for each snap application. This means that each snap package runs in its own isolated environment, preventing interference with other snaps or the host system’s filesystem.

Update:
Appreciate the commit.

2 Likes