Skip to content

Conversation

ldzhong
Copy link

@ldzhong ldzhong commented Feb 6, 2025

For the first patch, when this package was first installed, the timer will be scheduled as monthly for btrfs-balance.service. However if the user modifies configuration options other than BTRFS_BALANCE_PERIOD in /etc/sysconfig/btrfsmaintenance, the timer will be changed to weekly without being noticed. To avoid such a case, it's better to keep the value in the .timer file and the configuration file same.
For the second patch, it tries to fix a timing window when editing the configuration file /etc/sysconfig/btrfsmaintenance. Please refer to the patch description for more detail.

monthly

make it align with the value in btrfs-balance.timer
configuration file exists

When tuning the value BTRFS_BALANCE_PERIOD in
/etc/sysconfig/btrfsmaintenance, btrfsmaintenance-refresh.service will
be triggered. But sometimes it will fail because the script
/usr/share/btrfsmaintenance/btrfsmaintenance-refresh-cron.sh claims the
file /etc/sysconfig/btrfsmaintenance does not exist. Because there's a
timing window between the service is triggered and the configuration
file is checked.
"""
Setting up watches.
Watches established.

/etc/sysconfig/ OPEN
/etc/sysconfig/ CLOSE_NOWRITE,CLOSE
/etc/sysconfig/ OPEN
/etc/sysconfig/ ACCESS
/etc/sysconfig/ CLOSE_NOWRITE,CLOSE
/etc/sysconfig/ MOVE_SELF
/etc/sysconfig/ ATTRIB
/etc/sysconfig/ DELETE_SELF
"""
As a result it will be chaos after the service file finishes.

Reference: bsc#1235954
@eku
Copy link

eku commented Feb 6, 2025

What's your motivation for the changes? What problems do they fix?

@ldzhong
Copy link
Author

ldzhong commented Feb 7, 2025

What's your motivation for the changes? What problems do they fix?

I have updated the description for these two unrelated patches. Thanks for your reminding.

@zatricky
Copy link

If the patches are unrelated, they should probably be in separate pull requests. Note that movement is a little slow here. :-)

The text in your first commit could probably make it more obvious that the default timer values are incorrectly different - and that this is in fact a fix to align the values. As is, it reads that you are making an arbitrary decision when that is not true.

@kdave
Copy link
Owner

kdave commented Aug 18, 2025

Please split the changes to two patches (in one pull request).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants