Quoting Paolo Bonzini (bonz...@gnu.org):
> I'm seeing errors like this in /var/log/messages at the same time as
> corruptions:
> 
> Feb  9 14:03:26 yakj kernel: [135241.310137] 
> ecryptfs_read_and_validate_header_region: Error reading header region; rc = 
> [-4]
> Feb  9 14:03:26 yakj kernel: [135241.310146] ecryptfs_decrypt_page: Error 
> attempting to read lower page; rc = [-4]
> Feb  9 14:03:26 yakj kernel: [135241.310147] ecryptfs_readpage: Error 
> decrypting page; rc = [-4]
> 
> -4 is EINTR.

That sounds to me like the ecryptfs should retry.  The reading of the lower
page just happened to get interrupted by a signal handler.  Something like:

>From bd6289242f82df4ef254b3e59d38dc39b9b2879d Mon Sep 17 00:00:00 2001
From: Serge E. Hallyn <serge.hal...@canonical.com>
Date: Mon, 14 Feb 2011 14:48:22 +0000
Subject: [PATCH 1/1] ecryptfs: retry ecryptfs_read_and_validate_header_region 
on -EINTR

Signed-off-by: Serge E. Hallyn <serge.hal...@canonical.com>
---
 fs/ecryptfs/crypto.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index bfd8b68..81d5fa7 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -1211,8 +1211,10 @@ int ecryptfs_read_and_validate_header_region(char *data,
 
        if (crypt_stat->extent_size == 0)
                crypt_stat->extent_size = ECRYPTFS_DEFAULT_EXTENT_SIZE;
-       rc = ecryptfs_read_lower(data, 0, crypt_stat->extent_size,
-                                ecryptfs_inode);
+       do {
+               rc = ecryptfs_read_lower(data, 0, crypt_stat->extent_size,
+                                        ecryptfs_inode);
+       } while (rc == -EINTR);
        if (rc < 0) {
                printk(KERN_ERR "%s: Error reading header region; rc = [%d]\n",
                       __func__, rc);
-- 
1.7.0.4

totally untested.

-serge

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/521523

Title:
  severe ecryptfs corruption

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to