From: Trond Myklebust Subject: Re: Why do we update ctime in generic_file_write? Date: 22 Jan 2003 14:31:12 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: References: <20030121180007.B1594@schatzie.adilger.int> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: To: Andreas Dilger In-Reply-To: <20030121180007.B1594@schatzie.adilger.int> List-Id: linux-fsdevel.vger.kernel.org >>>>> " " == Andreas Dilger writes: > I was looking at the code in generic file write (both 2.4 and > 2.5) and in both cases we update the ctime always. My > understanding here is that the mtime reflects the data > modification time, while the ctime reflects the inode change > time, so we should only be updating the ctime (at most) if the > file size was increased, and not if we are overwriting data. See the Single UNIX Specification on http://www.opengroup.org/cgi-bin/sussearch.pl st_ctime is always supposed to be updated whenever st_mtime is (although the converse is not true). Cheers, Trond