ecryptfs: corrupted files on a disk full event
A message that is not in the archive (sent off-list or not yet received): 20121009173522.5563.81022.reportbug@klapprechner
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 1349874250.6874.6.camel@klapprechner
Hi Ben and Greg,
Please consider
8bc2d3cf6129 eCryptfs: Unlink lower inode when ecryptfs_create() fails e3ccaa976120 eCryptfs: Initialize empty lower files when opening them 821f7494a776 eCryptfs: Revert to a writethrough cache model 7149f2558d5b eCryptfs: Write out all dirty pages just before releasing the
lower file
64e6651dcc10 eCryptfs: Call lower ->flush() from ecryptfs_flush()
for application to the 3.0.y, 3.2.y, and 3.4.y trees. (These fixes were all applied to mainline during the 3.6 cycle.)
The patches apply cleanly to 3.2.y. The backport to 3.0.y would take more work since it lacks, for example, b59db43ad443 (eCryptfs: Prevent file create race condition, 2011-11-21).
Patches 1-4 improve error handling and recovery. The fifth ensures flushes get propagated to the underlying filesystem, which would be important to avoid data loss from power loss or crashes.
Sebastian Heinlein wrote[1], testing against 3.2.y:
Quoted 1 line
After a running into a full disk event with my ecrypts encrypted home directory
[...]
Quoted 1 line
I see a lot of random broken files on my system:
[...]
Quoted 1 line
Applying all 5 patches fixed all issues for me.
[...]
Quoted 4 lines
I don't get any zero sized files anymore with a full disk (find $HOME/.Private/ -size 0c). I can even login with the user having a full disk (before often a broken .ICEauthority made this inpossible. I could not see any data corruptions in applications (Evolution, Iceweasel).
[...]
Quoted 1 line
The dd command which fills up the disk also exits correctly.
Thoughts welcome, as always.
Thanks,
Jonathan
Quoted 14 lines · Jonathan Nieder
Hi Ben and Greg,
Please consider
8bc2d3cf6129eCryptfs: Unlink lower inode whenecryptfs_create()failse3ccaa976120eCryptfs: Initialize empty lower files when opening them821f7494a776eCryptfs: Revert to a writethrough cache model7149f2558d5beCryptfs: Write out all dirty pages just before releasing the
lower file
64e6651dcc10eCryptfs: Call lower ->flush() fromecryptfs_flush()for application to the 3.0.y, 3.2.y, and 3.4.y trees. (These fixes were all applied to mainline during the 3.6 cycle.)
Quoted 7 lines
The patches apply cleanly to 3.2.y. The backport to 3.0.y would take more work since it lacks, for example,
b59db43ad443(eCryptfs: Prevent file create race condition, 2011-11-21).Patches 1-4 improve error handling and recovery. The fifth ensures flushes get propagated to the underlying filesystem, which would be important to avoid data loss from power loss or crashes.
[...]
They all sound worthwhile, and I understand they have already had some testing on Ubuntu's 3.2-based branch. Therefore, added to the queue.
Ben.
Signature · 3 lines
Ben Hutchings Always try to do things in chronological order; it's less confusing that way.
Greg KH
AppliedQuoted 14 lines · Jonathan Nieder
Hi Ben and Greg,
Please consider
8bc2d3cf6129eCryptfs: Unlink lower inode whenecryptfs_create()failse3ccaa976120eCryptfs: Initialize empty lower files when opening them821f7494a776eCryptfs: Revert to a writethrough cache model7149f2558d5beCryptfs: Write out all dirty pages just before releasing the
lower file
64e6651dcc10eCryptfs: Call lower ->flush() fromecryptfs_flush()for application to the 3.0.y, 3.2.y, and 3.4.y trees. (These fixes were all applied to mainline during the 3.6 cycle.)
Quoted 7 lines
The patches apply cleanly to 3.2.y. The backport to 3.0.y would take more work since it lacks, for example,
b59db43ad443(eCryptfs: Prevent file create race condition, 2011-11-21).Patches 1-4 improve error handling and recovery. The fifth ensures flushes get propagated to the underlying filesystem, which would be important to avoid data loss from power loss or crashes.
Applied to the 3.4 tree, they didn't work on 3.0. If you have backports for 3.0, that would be great to have.
thanks,
greg k-h
Quoted 10 lines · Jonathan Nieder
Hi Ben and Greg,
Please consider
8bc2d3cf6129eCryptfs: Unlink lower inode whenecryptfs_create()failse3ccaa976120eCryptfs: Initialize empty lower files when opening them821f7494a776eCryptfs: Revert to a writethrough cache model7149f2558d5beCryptfs: Write out all dirty pages just before releasing the
lower file
64e6651dcc10eCryptfs: Call lower ->flush() fromecryptfs_flush()
What about also picking the following two for stables?
069ddcda37b2cf5bb4b6031a944c0e9359213262
eCryptfs: Copy up POSIX ACL and read-only flags from lower mount
5f5b331d5c21228a6519dcb793fc1629646c51a6
eCryptfs: check for eCryptfs cipher support at mount
Quoted 12 lines
for application to the 3.0.y, 3.2.y, and 3.4.y trees. (These fixes were all applied to mainline during the 3.6 cycle.)
The patches apply cleanly to 3.2.y. The backport to 3.0.y would take more work since it lacks, for example,
b59db43ad443(eCryptfs: Prevent file create race condition, 2011-11-21).Patches 1-4 improve error handling and recovery. The fifth ensures flushes get propagated to the underlying filesystem, which would be important to avoid data loss from power loss or crashes.
[...]
Quoted 6 lines
Thoughts welcome, as always.
Thanks,
Jonathan
Signature · 2 lines
[]'s Herton
Quoted 12 lines · Herton Ronaldo Krzesinski
Quoted 10 lines · Jonathan Nieder
Hi Ben and Greg,
Please consider
8bc2d3cf6129eCryptfs: Unlink lower inode whenecryptfs_create()failse3ccaa976120eCryptfs: Initialize empty lower files when opening them821f7494a776eCryptfs: Revert to a writethrough cache model7149f2558d5beCryptfs: Write out all dirty pages just before releasing the
lower file
64e6651dcc10eCryptfs: Call lower ->flush() fromecryptfs_flush()
Quoted 7 lines
What about also picking the following two for stables?
069ddcda37b2cf5bb4b6031a944c0e9359213262
eCryptfs: Copy up POSIX ACL and read-only flags from lower mount
5f5b331d5c21228a6519dcb793fc1629646c51a6
eCryptfs: check for eCryptfs cipher support at mount
[...]
Added to the queue for 3.2, thanks.
Ben.
Signature · 3 lines
Ben Hutchings For every complex problem there is a solution that is simple, neat, and wrong.
Quoted 12 lines · Herton Ronaldo Krzesinski
Quoted 10 lines · Jonathan Nieder
Hi Ben and Greg,
Please consider
8bc2d3cf6129eCryptfs: Unlink lower inode whenecryptfs_create()failse3ccaa976120eCryptfs: Initialize empty lower files when opening them821f7494a776eCryptfs: Revert to a writethrough cache model7149f2558d5beCryptfs: Write out all dirty pages just before releasing the
lower file
64e6651dcc10eCryptfs: Call lower ->flush() fromecryptfs_flush()
Quoted 7 lines
What about also picking the following two for stables?
069ddcda37b2cf5bb4b6031a944c0e9359213262
eCryptfs: Copy up POSIX ACL and read-only flags from lower mount
5f5b331d5c21228a6519dcb793fc1629646c51a6
eCryptfs: check for eCryptfs cipher support at mount
Both now applied to the 3.0 and 3.4 stable trees, thanks.
greg k-h