-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fstrim: ignore automount #1463
Comments
Ah, very good catch. That's strange that someone else did not report it yet. I guess it has to be a pretty common problem. The committed change:
Thanks! |
karelzak
added a commit
that referenced
this issue
Oct 4, 2021
Addresses: #1463 Signed-off-by: Karel Zak <kzak@redhat.com>
Thanks for the fix! I think it may not be a very common problem because:
|
3 tasks
karelzak
added a commit
to redhat-plumbers/util-linux-rhel
that referenced
this issue
Jan 31, 2023
- ignore read-only entries - ignore autofs entries (for example from /proc/self/mountinfo) - ignore autofs mountpoints where automounter has not been triggered yet Fixes: util-linux/util-linux#1463 Signed-off-by: Karel Zak <kzak@redhat.com> Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2165981
karelzak
added a commit
to redhat-plumbers/util-linux-rhel
that referenced
this issue
Jan 31, 2023
Addresses: util-linux/util-linux#1463 Signed-off-by: Karel Zak <kzak@redhat.com> Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2165981
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
/etc/fstab
, we can usex-systemd.automount
option to set up a automount. In our case, we set up a lot of read-only automount for our datasets. Once these automounts are triggered, they will in turn trigger the network block device mapping (Ceph RBD). However,fstrim --fstab
will trigger all these mappings, and return errors likefstrim: /mnt/rbd/datasets/ImageNet: the discard operation is not supported
, which is not desired.The automount is triggered at https://github.com/karelzak/util-linux/blob/e549619122b62b587b5aeb1b2ba3ca565010dc6d/sys-utils/fstrim.c#L101
Before automount is triggered, fstrim fails to detect this is a read-only mount.
access
returns 0https://github.com/karelzak/util-linux/blob/e549619122b62b587b5aeb1b2ba3ca565010dc6d/sys-utils/fstrim.c#L340
and before automount is triggered, the block device does not exists, so
has_discard
check also fails.https://github.com/karelzak/util-linux/blob/d4319b91c9d7d69e7b954fc66819214f81501312/sys-utils/fstrim.c#L157-L159
I propose the following possible improvement on this:
statfs
then ignore those havingf_type == AUTOFS_SUPER_MAGIC
The text was updated successfully, but these errors were encountered: