ssd_trim trims the same filesystem once per bind mount

Abierto
#2,796 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@Joly0 ya está trabajando en esto.

Desde el 22/10/2026.

  • #2797 de @Joly0 — abierto

Evaluación

Dificultad
1/5
Tiempo estimado
Menos de una hora
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
linux, shell
Área
devops

Línea de trabajo

Start with emhttp/plugins/dynamix/scripts/ssd_trim, especially xfs_btrfs_trim(), and inspect how findmnt -lnt btrfs,xfs -J results are filtered and passed to fstrim. The issue describes selecting one mount per MAJ:MIN and preferring FSROOT == "/"; PR #2797 is already open. Done means each filesystem is trimmed once through its root mount when available.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary

The scheduled SSD trim (emhttp/plugins/dynamix/scripts/ssd_trim, xfs_btrfs_trim()) runs fstrim once per mount of a filesystem instead of once per filesystem. Every bind mount of a pool is trimmed again, and since fstrim always trims the whole filesystem, a pool with three bind mounts is trimmed four times in a row.

Why it happens

The mount list comes from findmnt -lnt btrfs,xfs -J, filtered on .source | test("^/dev/"). A bind mount of a directory on the pool has a source like /dev/nvme0n1p1[/docker], which matches too.

On a 7.4.0-rc.1 server with a 4-device btrfs cache pool, findmnt lists the pool four times:

/mnt/cache                                    0:55  /
/var/lib/docker                               0:55  /docker
<plugin bind mount>                           0:55  /appdata/...
<plugin bind mount>                           0:55  /appdata/...

/var/lib/docker alone is enough to get two passes on any server that uses a Docker directory on a pool.

Impact

On this server one pass over the cache pool takes about 3.5 hours (the 05:00 run reached the second mount at 08:33), so the whole run would last over 14 hours and overlap with normal use. The array was stopped during it, and the running fstrim held a bind mount, so umount /mnt/cache failed with "target is busy" until it was lazily unmounted by hand.

Expected

Each filesystem is trimmed once, preferably through the mount of its root.

Fix

Select MAJ:MIN and FSROOT from findmnt, keep one entry per MAJ:MIN, and prefer FSROOT == "/". PR: #2797

Lenguaje dominante
PHP
Estrellas
266
Forks
116
Merge medio
1 d 5 h
PR fusionados (30 d)
4

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de unraid/webgui

Todos los issues de unraid/webgui

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.