From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Emelyanov Subject: Re: [PATCH 6/10] fuse: Trust kernel i_size only Date: Tue, 10 Jul 2012 09:53:52 +0400 Message-ID: <4FFBC370.7070807@parallels.com> References: <4FF3156E.8030109@parallels.com> <4FF3160B.6090501@parallels.com> <8762a3pp3m.fsf@tucsk.pomaz.szeredi.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "fuse-devel@lists.sourceforge.net" , Alexander Viro , linux-fsdevel , James Bottomley , Kirill Korotaev To: Miklos Szeredi Return-path: Received: from mailhub.sw.ru ([195.214.232.25]:25264 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752306Ab2GJFyI (ORCPT ); Tue, 10 Jul 2012 01:54:08 -0400 In-Reply-To: <8762a3pp3m.fsf@tucsk.pomaz.szeredi.hu> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 07/04/2012 06:39 PM, Miklos Szeredi wrote: > Pavel Emelyanov writes: > >> Make fuse think that when writeback is on the inode's i_size is alway >> up-to-date and not update it with the value received from the >> userspace. This is done because the page cache code may update i_size >> without letting the FS know. > > Similar rule applies to i_mtime. Except it's even more tricky, since > you have to flush the mtime together with the data (the flush should not > update the modification time). And we have other operations which also > change the mtime, and those also need to be updated. > > We should probably look at what NFS is doing. Miklos, I've looked at how NFS and FUSE manage the i_mtime. The NFS (if not looking at the fscache) tries to keep the i_mtime at the maximum between the local and the remote values. This looks like correct behavior for FUSE too. But, looking at the FUSE code I see that the existing attr_version checks do implement the same approach even if we turn the writeback cache (this series) ON. That said, I see no problems with the i_mtime management after this series. Is there something I've missed? Thanks, Pavel