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

file size incorrect briefly after hard link creation #724

Closed
joeyh opened this issue Mar 28, 2023 · 6 comments
Closed

file size incorrect briefly after hard link creation #724

joeyh opened this issue Mar 28, 2023 · 6 comments
Labels

Comments

@joeyh
Copy link

joeyh commented Mar 28, 2023

If a file is hard linked and statted immediately afterwards, it always appears 50 bytes larger than the actual file size. Within 1 second whatever is causing this corrects itself.

joey@darkstar:~/mnt>echo hi > a
joey@darkstar:~/mnt>ln a b ; stat b ; sleep 1; stat b
  File: b
  Size: 53        	Blocks: 8          IO Block: 4096   regular file
Device: 0,57	Inode: 13244313    Links: 2
Access: (0644/-rw-r--r--)  Uid: ( 1000/    joey)   Gid: ( 1000/    joey)
Access: 2023-03-28 13:59:26.326414785 -0400
Modify: 2023-03-28 13:59:26.326414785 -0400
Change: 2023-03-28 13:59:28.890424359 -0400
 Birth: -
  File: b
  Size: 3         	Blocks: 8          IO Block: 4096   regular file
Device: 0,57	Inode: 13244313    Links: 2
Access: (0644/-rw-r--r--)  Uid: ( 1000/    joey)   Gid: ( 1000/    joey)
Access: 2023-03-28 13:59:26.326414785 -0400
Modify: 2023-03-28 13:59:26.326414785 -0400
Change: 2023-03-28 13:59:28.890424359 -0400
 Birth: -
joey@darkstar:~/mnt>mount | grep /mnt
/home/joey/tmp/goc on /home/joey/mnt type fuse.gocryptfs (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000,max_read=131072)

I am testing on Debian, kernel 6.0.0-6-amd64. Using gocryptfs version 2.3-1+b3 installed from Debian unstable.

An example of this breaking a program is at https://git-annex.branchable.com/forum/Can_you_use_git_annex_on_gocryptfs__63__/

@joeyh
Copy link
Author

joeyh commented Mar 28, 2023

Note that according to the user on that page, version 1.8.0 does not have this problem.

@lechner
Copy link
Contributor

lechner commented Mar 28, 2023

@rfjakob Hi, I am excited about this filing! As your former Debian maintainer, I feel obligated to point out that @joeyh is (or perhaps was) Debian royalty. He (or perhaps they) made many significant and lasting contributions to free software, including Ikiwiki. You can read more here.

@rfjakob rfjakob added the bug label Mar 29, 2023
@rfjakob
Copy link
Owner

rfjakob commented Mar 29, 2023

Thanks for the report. Looks like I broke this in the v2.0 rewrite.

Fixed now, and test added so this cannot regress again.

@neurolit
Copy link

Hi @rfjakob! Thank you very much for developing gocryptfs, it is really useful. As you fixed this bug, would you mind releasing a new version?

Sorry to bother you if your release planning follows some rules I am not aware of.

@dpifke
Copy link

dpifke commented Apr 24, 2023

As the person who reported the git-annex issue, I can confirm that git-annex now seems to work perfectly when using gocryptfs built from master. Tested just now with:

gocryptfs v2.3.1-3-g24b3978; go-fuse v2.1.1-0.20221117175120-915cf5413cde; 2023-04-24 go1.19.3 linux/amd64

(Apologies for the delayed response; I forgot to circle back and re-test.)

@rfjakob
Copy link
Owner

rfjakob commented Apr 29, 2023

Released as https://github.com/rfjakob/gocryptfs/releases/tag/v2.3.2

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

No branches or pull requests

5 participants