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

filerec_count_shared(): fix sharing accounting #323

Merged
merged 1 commit into from Nov 12, 2023
Merged

filerec_count_shared(): fix sharing accounting #323

merged 1 commit into from Nov 12, 2023

Conversation

trofi
Copy link
Contributor

@trofi trofi commented Nov 9, 2023

Before the change filerec_count_shared() incorrectly accounted for extent end compared to file end:

$ ls -lh /nix/var/nix/db/db.sqlite
-rw-r--r-- 1 root root 1.4G Nov  9 22:21 /nix/var/nix/db/db.sqlite

Before the change due to incorrect tail handling sharing reported size larger than the file itself:

$ ./show-shared-extents /nix/var/nix/db/db.sqlite
/nix/var/nix/db/db.sqlite: 27065321263104 shared bytes

After the change sharing reports a reasonable value:

$ ./show-shared-extents /nix/var/nix/db/db.sqlite
/nix/var/nix/db/db.sqlite: 1169276928 shared bytes

Note: before the change sharing reported a few orders of magnitude savings larger than initial file size. After the change the value is more reasonable.

Before the change `filerec_count_shared()` incorrectly accounted for
extent end compared to file end:

    $ ls -lh /nix/var/nix/db/db.sqlite
    -rw-r--r-- 1 root root 1.4G Nov  9 22:21 /nix/var/nix/db/db.sqlite

Before the change due to incorrect tail handling sharing reported size
larger than the file itself:

    $ ./show-shared-extents /nix/var/nix/db/db.sqlite
    /nix/var/nix/db/db.sqlite: 27065321263104 shared bytes

After the change sharing reports a reasonable value:

    $ ./show-shared-extents /nix/var/nix/db/db.sqlite
    /nix/var/nix/db/db.sqlite: 1169276928 shared bytes

Note: before the change sharing reported a few orders of magnitude
savings larger than initial file size. After the change the value is
more reasonable.
@JackSlateur JackSlateur merged commit 395529f into markfasheh:master Nov 12, 2023
@JackSlateur
Copy link
Collaborator

JackSlateur commented Nov 12, 2023

Thank you for improving this report

@trofi trofi deleted the sharing-fix-accounting branch November 12, 2023 19:11
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.

None yet

2 participants