Commit Graph

6 Commits

Author SHA1 Message Date
Stoiko Ivanov
5891aaec34 /lib/zfs-linux/trim: don't exit 1 if last pool isn't nvme-only (Closes: #1030316)
(cherry picked from debian-upstream[0]
commit 8ed69adac193f6463832f6ae34b5ded88b8014d8)

[0] https://salsa.debian.org/zfsonlinux-team/zfs
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2023-06-13 15:23:49 +02:00
Stoiko Ivanov
dceb3ed09f trim: clean up, fix
This does:
  * fix get_transp() on non-bash
  * re-indent of the code from #990745
  * fix terminology: it's pool
  * remove -e: I originally actually fixed -e,
    but it turns out literally every bit that could fail
    is already either || : or wasn't by accident (like in the #990745 code)
  * simplify get_transp() and explain why we do it instead of matching nvme path
  * use remove -L from the data we feed to lsblk, zpool w/o -L is measurably faster
  * pipe the devices into while read to match rest of code
  * use read -r in main loop
  * match the userprop with case/esac instead of if tree
  * shellcheck-clean the script

(cherry picked from debian-upstream[0]
commit 769a09407c6b65db981804a05a81ea63d004ebeb)

[0] https://salsa.debian.org/zfsonlinux-team/zfs
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2022-12-06 16:39:35 +01:00
Stoiko Ivanov
68b54bb663 trim: determine if a device uses nvme transport with lsblk (Closes: #990745)
Thanks to Miao Wang for get_transp() function

(cherry picked from debian-upstream[0]
commit 1f5433b15e4f7c823983bb90390c4b023f3d1948)

[0] https://salsa.debian.org/zfsonlinux-team/zfs
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2022-10-04 16:06:34 +02:00
Stoiko Ivanov
f17f9da9f3 sync scrub and trim cronjobs with debian upstream
* Pull in the changes to the automatic scrub cronjob from
  debian-upstream [0] commit
  f6d45405df0a2ed2748975667e8ea50714034d13
* Add a script and cronjob for regular trimming of pools
* Change the logic to scrub/trim pools based on a per pool('s root
  dataset property)

pulled the changes in as one commit instead of cherry-picking, since
the planned and reverted debconf questions would have caused
unneccessary churn.

commits identified by running:
`git log --full-diff -- debian/tree/zfsutils-linux/usr/lib/zfs-linux`
in a worktree from [0].

[0] https://salsa.debian.org/zfsonlinux-team/zfs/
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2021-06-18 15:25:41 +02:00
Richard Laager
4472322f60 cron: Do not error if already scrubbing
If a pool is already scrubbing, zpool scrub will return an error.  This
breaks the cron scrub script.  It outputs that error and then does not
scrub any further pools.

This change checks to see if the pool is scrubbing before attempting to
start a scrub.  This addresses long-running scrubs.  Note that a
"long-running" scrub here is not necessarily a month long.  If the
system is shut off or the pool is exported, the scrub will resume later.

(cherry picked from 41e457da7bfc837a52f3389cb6961bc6737b874d [0])

[0]  https://salsa.debian.org/zfsonlinux-team/zfs.git

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-03-23 08:08:11 +01:00
Stoiko Ivanov
886e4c966e Move zfs to top-level directory
With the merge of spl and zfs the extra level of directories is not needed
anymore.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-05-24 12:02:52 +02:00