palainp / mirage-sshfs

ISC License
22 stars 1 forks source link

bogus filesizes? #14

Closed palainp closed 1 year ago

palainp commented 1 year ago

Something is strange with the size using chamelon:

$ sshfs mirage@127.0.0.1:/ ~/sshfs -p 22022 -o IdentityFile=/home/user/mirage/mirage-sshfs/username && mkdir -p ~/sshfs/test && echo ok > ~/sshfs/test/bla && ls -l ~/sshfs/test && cp ~/sshfs/test/bla ~/sshfs/test/bla2 && ls -l ~/sshfs/test && cat ~/sshfs/test/bla
total 4
-rwxrwxrwx 1 root root 3 Feb 25 12:13 bla
total 8
-rwxrwxrwx 1 root root 3 Feb 25 12:13 bla
-rwxrwxrwx 1 root root 6 Feb 25 12:13 bla2
ok
$ ls -l ~/sshfs/test
total 8
-rwxrwxrwx 1 root root 6 Feb 25 12:13 bla
-rwxrwxrwx 1 root root 6 Feb 25 12:13 bla2
palainp commented 1 year ago

Fixed in chamelon "Update to Mirag_kv 6.0.1" PR.

palainp commented 1 year ago

There still an issue with directory size if computed with the size of all its elements. As we add a fictive '.' file to create an empty directory, we always have a size increased by 1 byte (except '/' where '.' isn't added). As the directory size is not really defined by Mirage_kv maybe this is not really an issue?