From: Tim Gardner <tim.gardner@canonical.com>
To: linux-fsdevel@vger.kernel.org, tyler.hicks@canonical.com
Cc: Tim Gardner <tim.gardner@canonical.com>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH 2/2] ecryptfs: Print inode on metadata error
Date: Wed, 11 Jan 2012 18:00:42 +0100 [thread overview]
Message-ID: <1326301242-5817-3-git-send-email-tim.gardner@canonical.com> (raw)
In-Reply-To: <1326301242-5817-1-git-send-email-tim.gardner@canonical.com>
If a lower file system file is corrupted, then ecryptfs prints
a generic and mostly useless log message when attempting to
read metadata. Print the inode associated with the file
so that a user can do something about it, e.g.,
find -inum INODE_NUM
Cc: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Cc: Tyler Hicks <tyler.hicks@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
fs/ecryptfs/crypto.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index ac063bd..affad0c 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -1612,8 +1612,9 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
rc = ecryptfs_read_lower(page_virt, 0, crypt_stat->extent_size,
ecryptfs_inode);
if (rc < 0) {
- printk(KERN_ERR "%s: Could not read %u bytes\n",
- __func__, crypt_stat->extent_size);
+ printk(KERN_ERR "%s: Could not read %zu bytes, inode %lu\n",
+ __func__, crypt_stat->extent_size,
+ ecryptfs_inode->i_ino);
goto out;
}
@@ -1625,7 +1626,8 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
rc = ecryptfs_read_xattr_region(page_virt, ecryptfs_inode);
if (rc) {
printk(KERN_DEBUG "Valid eCryptfs headers not found in "
- "file header region or xattr region\n");
+ "file header region or xattr region, inode %lu\n",
+ ecryptfs_inode->i_ino);
rc = -EINVAL;
goto out;
}
@@ -1634,7 +1636,8 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
ECRYPTFS_DONT_VALIDATE_HEADER_SIZE);
if (rc) {
printk(KERN_DEBUG "Valid eCryptfs headers not found in "
- "file xattr region either\n");
+ "file xattr region either, inode %lu\n",
+ ecryptfs_inode->i_ino);
rc = -EINVAL;
}
if (crypt_stat->mount_crypt_stat->flags
@@ -1645,7 +1648,8 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
"crypto metadata only in the extended attribute "
"region, but eCryptfs was mounted without "
"xattr support enabled. eCryptfs will not treat "
- "this like an encrypted file.\n");
+ "this like an encrypted file, inode %lu\n",
+ ecryptfs_inode->i_ino);
rc = -EINVAL;
}
}
--
1.7.8.3
next prev parent reply other threads:[~2012-01-11 17:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-11 17:00 [PATCH 0/2] ecryptfs: Improved metadata read failure logging Tim Gardner
2012-01-11 17:00 ` [PATCH 1/2] ecryptfs: Improve metatdata " Tim Gardner
2012-01-11 20:36 ` Kees Cook
2012-01-12 12:00 ` Tyler Hicks
2012-01-12 16:45 ` Tim Gardner
2012-01-20 19:50 ` Tyler Hicks
2012-01-20 20:17 ` Tim Gardner
2012-01-11 17:00 ` Tim Gardner [this message]
2012-01-11 20:38 ` [PATCH 2/2] ecryptfs: Print inode on metadata error Kees Cook
2012-01-12 12:02 ` Tyler Hicks
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1326301242-5817-3-git-send-email-tim.gardner@canonical.com \
--to=tim.gardner@canonical.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tyler.hicks@canonical.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).