From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: truncate in ecryptfs Date: Wed, 14 Oct 2009 17:12:21 +0200 Message-ID: <20091014151221.GA18371@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: tyhicks@linux.vnet.ibm.com, kirkland@canonical.com Return-path: Received: from verein.lst.de ([213.95.11.210]:43533 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755555AbZJNPNB (ORCPT ); Wed, 14 Oct 2009 11:13:01 -0400 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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.