From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tyler Hicks Subject: Re: truncate in ecryptfs Date: Wed, 14 Oct 2009 10:37:26 -0500 Message-ID: <4AD5F036.5030209@linux.vnet.ibm.com> References: <20091014151221.GA18371@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kirkland@canonical.com, linux-fsdevel@vger.kernel.org To: Christoph Hellwig Return-path: Received: from e39.co.us.ibm.com ([32.97.110.160]:58400 "EHLO e39.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934552AbZJNPlM (ORCPT ); Wed, 14 Oct 2009 11:41:12 -0400 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e39.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id n9EFYi8p032363 for ; Wed, 14 Oct 2009 09:34:44 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id n9EFeNOj099044 for ; Wed, 14 Oct 2009 09:40:27 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n9EFeIiq007890 for ; Wed, 14 Oct 2009 09:40:19 -0600 In-Reply-To: <20091014151221.GA18371@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 10/14/2009 10:12 AM, Christoph Hellwig wrote: > It looks like ecryptfs calls vmtruncate directly on the lower filesystem, > which is quite wrong. Vmtruncate is only a helper for the filesystem, > and while most filesystems end up calling vmtruncate from their > ->setattr implementation if ATTR_SIZE is set there are many that require > additional work. I think ecryptfs needs to got through notify_change() > / ->setattr if it wants truncate to work reliably and without silent > corruption or leaking blocks on a variety of filesystems. Thanks Christoph! I agree and will write up a patch shortly. I also opened a bug to track the progress: https://bugs.launchpad.net/ecryptfs/+bug/451368 Tyler