From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH] eCryptfs: Use notify_change for truncating lower inodes Date: Sun, 25 Oct 2009 08:22:19 +0100 Message-ID: <20091025072219.GC17121@lst.de> References: <4AD5F036.5030209@linux.vnet.ibm.com> <1255580377-16577-1-git-send-email-tyhicks@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, Christoph Hellwig , Dustin Kirkland , ecryptfs-devel@lists.launchpad.net To: Tyler Hicks Return-path: Received: from verein.lst.de ([213.95.11.210]:43627 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751310AbZJYHWS (ORCPT ); Sun, 25 Oct 2009 03:22:18 -0400 Content-Disposition: inline In-Reply-To: <1255580377-16577-1-git-send-email-tyhicks@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Oct 14, 2009 at 11:19:37PM -0500, Tyler Hicks wrote: > 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(). > > This patch moves the lower inode truncation out of ecryptfs_truncate() > and renames the function 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. > > For eCryptfs functions needing to truncate, ecryptfs_truncate() is > reintroduced as a simple way to truncate the upper inode to a specified > size and then truncate the lower inode accordingly. Thanks, this looks correct to me from glacing over it.