Skip to content

file size incorrect briefly after hard link creation #724

Closed
@joeyh

Description

@joeyh

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__/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions