remounting breaks size reporting and rsync
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
eCryptfs |
In Progress
|
Medium
|
Jason Xing | ||
ecryptfs-utils |
Invalid
|
Undecided
|
Unassigned | ||
linux (Ubuntu) |
Confirmed
|
Low
|
Tyler Hicks |
Bug Description
Sorry to resurrect an old bug, it looks like a fix applied a while back may end up breaking rsync.
For reference, it looks like the decision in this bug fix was to pass on the encrypted file size on disk to stat calls looking at the unencrypted mount:
https:/
For reference, to reproduce:
mkdir /mnt/raw
mkdir /mnt/decrypted
dd if=/dev/urandom of=file.out2 bs=1MB count=100
mount -t ecryptfs -o ecryptfs_
rsync file.out2 /mnt/decrypted/
stat /mnt/decrypted/
# you get size 100000000
umount /mnt/decrypted/
mount -t ecryptfs -o ecryptfs_
stat /mnt/decrypted/
# you get size 100003840
What this means in practice is any additional rsyncs to that target after remounting will see the file size as different than the original, and issue a full new copy. My use case is ecryptfs over a remote file system, so rsync is no better than cp.
Would it be possible to make file size reporting consistent, and reflective of the size of the file as a reader would see it?
tags: | added: patch |
Running 16.04
$ uname -a
Linux spore 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux