Skip to content
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

Changes to metadata ignored when multiple modifications are performed under time limit #7

Open
LHLaurini opened this issue Jan 28, 2023 · 1 comment

Comments

@LHLaurini
Copy link

LHLaurini commented Jan 28, 2023

$ mkdir version-dir
$ mkdir mountpoint
$ copyfs-mount $PWD/version-dir mountpoint
/home/user/test/version-dir
$ cd mountpoint/
$ echo content > file; chmod 777 file
$ ls -lh
total 4,0K
-rw-r--r-- 1 user user 8 jan 28 19:37 file
$ chmod 777 file
$ ls -lh
total 4,0K
-rwxrwxrwx 1 user user 8 jan 28 19:37 file

As you can see, creating a file and then immediately changing its mode, will cause the mode change to be ignored. This is a problem when running scripts.

The problem seems to be caused by trying to avoid creating unnecessary versions:

fuse-copyfs/create.c

Lines 148 to 150 in 66b8df2

/* Check timestamp in order not to create bogus new versions */
if (time(NULL) - metadata->md_timestamp < TIME_LIMIT)
return 0;

If I set TIME_LIMIT to 0, the problem disappears.

@cognusion
Copy link
Owner

Yes, this is a known issue. It results in the best experience for 99.9999% of operations but unfortunately does create an eyesore for the odd case.

I will gladly accept a PR that allows dynamic changes to temporarily adjust the value, but am resistant to changes that are either hard-coded or require remounting.

One solution, if you're looking for brain food, is to externalize TIME_LIMIT so in the event you want to run a script that needs to make microchanges to the file, you could do e.g. TIME_LIMIT=0 ./my script.sh.

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

No branches or pull requests

2 participants