FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

LinkBack Thread Tools
Old 02-16-2012, 04:48 PM
Tim Gardner
Default APPLIED: eCryptfs: Use notify_change for truncating lower inodes

On 02/16/2012 07:38 AM, Colin King wrote:

From: Colin Ian King<colin.king@canonical.com>

SRU Justification:

When truncating inodes in the lower filesystem, eCryptfs directly
invoked vmtruncate(). As Christoph Hellwig pointed out, vmtruncate() is
a filesystem helper function, but filesystems may need to do more than
just a call to vmtruncate(). eCryptfs needs to go through
notify_change()->setattr to ensure truncate works reliable without
corruption or leaking blocks on a variety of filesystems.

See: http://thread.gmane.org/gmane.linux.file-systems/36105

Fix: With this patch , lower inode truncation is moved out of
ecryptfs_truncate() and the function is renamed to truncate_upper().
truncate_upper() updates an iattr for the lower inode to indicate
if the lower inode needs to be truncated upon return.
ecryptfs_setattr() then calls notify_change(), using the updated iattr
for the lower inode, to complete the truncation.

Without the patch we risk corrupting or leaking blocks on the lower

Has been soak tested with a variety of ftruncate() soak tests and also
running a full kernel build on ecryptfs with a lower ext4 filesystem.


This is a backport of commit 5f3ef64f4da1c587cdcfaaac72311225b7df094c

Colin Ian King (1):
eCryptfs: Use notify_change for truncating lower inodes

fs/ecryptfs/inode.c | 99 ++++++++++++++++++++++++++++++++++----------------
1 files changed, 67 insertions(+), 32 deletions(-)

Tim Gardner tim.gardner@canonical.com

kernel-team mailing list

Thread Tools

All times are GMT. The time now is 10:02 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org