From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH v2 2/3] mm: Update file times when inodes are written after mmaped writes Date: Thu, 3 Jan 2013 19:56:42 +0100 Message-ID: <20130103185642.GA5699@quack.suse.cz> References: <6b22b806806b21af02b70a2fa860a9d10304fc16.1356124965.git.luto@amacapital.net> <20121222082933.GA26477@infradead.org> <20121231161135.GH7564@quack.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kara , Christoph Hellwig , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linux FS Devel , Dave Chinner , Al Viro To: Andy Lutomirski Return-path: Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Thu 03-01-13 09:49:37, Andy Lutomirski wrote: > On Mon, Dec 31, 2012 at 8:11 AM, Jan Kara wrote: > > On Sat 22-12-12 00:43:30, Andy Lutomirski wrote: > >> On Sat, Dec 22, 2012 at 12:29 AM, Christoph Hellwig wrote: > >> > NAK, we went through great trouble to get rid of the nasty layering > >> > violation where the VM called file_update_time directly just a short > >> > while ago, reintroducing that is a massive step back. > >> > [...] > >With the call from > > remove_vma() it is more problematic (and the calling context there is > > harder as well because we hold mmap_sem). We could maybe leave the call > > upto filesystem's ->release callback (and provide generic ->release handler > > which just calls mapping_flush_cmtime()). It won't be perfect because that > > gets called only after the last file descriptor for that struct file is > > closed (i.e., if a process forks and child inherits mappings, ->release gets > > called only after both parent and the child unmap the file) but it should > > catch 99% of the real world cases. Christoph, would the be OK with > > you? > > I'm not sure that 99% is good enough -- I'd be nervous about breaking > some build or versioning system. > > vm_ops->close is almost a good place for this, except that it's called > on some failure paths and it will mess up is_mergeable_vma if lots of > filesystems suddenly have a ->close operation. What about adding > vm_ops->flush, which would be called in remove_vma and possibly > msync(MS_ASYNC)? I think that all real filesystems (i.e. things that > care about cmtime updates) have vm_operations. Yeah, that could work. I'm still somewhat nervous about updating the time stamp under mmap_sem but in ->page_mkwrite we were in the same situation so I guess it's fine. Honza -- Jan Kara SUSE Labs, CR -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org