Just so I don't forget, a decent way of reproducing this is by doing the following:
(ext4 is mounted at /lower and eCryptfs is mounted at /upper and foo isn't created until the truncate below)
# truncate -s 1 /upper/foo
# hexedit /lower/foo
Note: increment the 9th byte by 1 so that the eCryptfs marker fails validation
# umount /upper/foo
# mount -i /upper/foo
# hexdump -C /upper/foo
hexdump: /upper/foo: Invalid argument
hexdump: /upper/foo: Bad file descriptor
# hexedit /lower/foo
Note: decrement the 9th byte by 1 so that the eCryptfs marker is correct again
# hexdump -C /upper/foo
Note: You should see extra zeroes at the end of the file
Just so I don't forget, a decent way of reproducing this is by doing the following:
(ext4 is mounted at /lower and eCryptfs is mounted at /upper and foo isn't created until the truncate below)
# truncate -s 1 /upper/foo
# hexedit /lower/foo
Note: increment the 9th byte by 1 so that the eCryptfs marker fails validation
# umount /upper/foo
# mount -i /upper/foo
# hexdump -C /upper/foo
hexdump: /upper/foo: Invalid argument
hexdump: /upper/foo: Bad file descriptor
# hexedit /lower/foo
Note: decrement the 9th byte by 1 so that the eCryptfs marker is correct again
# hexdump -C /upper/foo
Note: You should see extra zeroes at the end of the file