New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disabled fstrim on BTRFS by default #2109
Conversation
Torxed
commented
Sep 25, 2023
- Fixes No need to enable periodic TRIM for btrfs #1837
- Fixes i am encountering fstrim error #1841
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. I overlooked the case where the filesystem is not BTRFS. Good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good; just heads up that this could go beyond btrfs
as new filesystems such as bcachefs
, PuzzleFS
, and/or SSDFS
could be implemented into the kernel later in some way, and some future filesystem(s) may not need periodic trim as well. You could consider changing the variable name to _need_periodic_trim
or something else, and consider reversing the boolean values (this also remove the not
).
I will approve otherwise, if desired.
Good idea, changed it to |
Great. Also, is there a particular reason we want a variable, as I don't see anything technical like a scope issue with directly using |
Are you referring to why we don't do the check outside before calling enable_fstrim? And if enable_fstrim is called as part of a custom script it's good if we do the check in the function to not cause issues for lib users. |