ssd_trim trims the same filesystem once per bind mount

オープン
#2,796 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Joly0 がすでに取り組んでいます。

2026年10月22日 から。

  • #2797 @Joly0 による — オープン

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
linux, shell
領域
devops

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
PHP
スター
266
フォーク
116
平均マージ
1日 5時間
マージ済み PR(30日)
4

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

unraid/webgui のほかの issue

unraid/webgui の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。