From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Chinner Subject: Re: Hole punching and mmap races Date: Fri, 18 May 2012 20:12:10 +1000 Message-ID: <20120518101210.GX25351@dastard> References: <20120515224805.GA25577@quack.suse.cz> <20120516021423.GO25351@dastard> <20120516130445.GA27661@quack.suse.cz> <20120517074308.GQ25351@dastard> <20120517232829.GA31028@quack.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, Hugh Dickins , linux-mm@kvack.org To: Jan Kara Return-path: Received: from ipmail07.adl2.internode.on.net ([150.101.137.131]:33741 "EHLO ipmail07.adl2.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756991Ab2ERKM1 (ORCPT ); Fri, 18 May 2012 06:12:27 -0400 Content-Disposition: inline In-Reply-To: <20120517232829.GA31028@quack.suse.cz> Sender: linux-ext4-owner@vger.kernel.org List-ID: On Fri, May 18, 2012 at 01:28:29AM +0200, Jan Kara wrote: > On Thu 17-05-12 17:43:08, Dave Chinner wrote: > > On Wed, May 16, 2012 at 03:04:45PM +0200, Jan Kara wrote: > > > On Wed 16-05-12 12:14:23, Dave Chinner wrote: > > IIRC, it's a rare case (that I consider insane, BTW): read from a > > file with into a buffer that is a mmap()d region of the same file > > that has not been faulted in yet..... > With punch hole, the race is less insane - just punching hole in the area > which is accessed via mmap could race in a bad way AFAICS. Seems the simple answer to me is to prevent page faults while hole punching, then.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id q4IACRN1123352 for ; Fri, 18 May 2012 05:12:27 -0500 Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by cuda.sgi.com with ESMTP id XdJGybxYzBDUsBL7 for ; Fri, 18 May 2012 03:12:24 -0700 (PDT) Date: Fri, 18 May 2012 20:12:10 +1000 From: Dave Chinner Subject: Re: Hole punching and mmap races Message-ID: <20120518101210.GX25351@dastard> References: <20120515224805.GA25577@quack.suse.cz> <20120516021423.GO25351@dastard> <20120516130445.GA27661@quack.suse.cz> <20120517074308.GQ25351@dastard> <20120517232829.GA31028@quack.suse.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120517232829.GA31028@quack.suse.cz> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: xfs-bounces@oss.sgi.com Errors-To: xfs-bounces@oss.sgi.com To: Jan Kara Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-ext4@vger.kernel.org, Hugh Dickins , xfs@oss.sgi.com On Fri, May 18, 2012 at 01:28:29AM +0200, Jan Kara wrote: > On Thu 17-05-12 17:43:08, Dave Chinner wrote: > > On Wed, May 16, 2012 at 03:04:45PM +0200, Jan Kara wrote: > > > On Wed 16-05-12 12:14:23, Dave Chinner wrote: > > IIRC, it's a rare case (that I consider insane, BTW): read from a > > file with into a buffer that is a mmap()d region of the same file > > that has not been faulted in yet..... > With punch hole, the race is less insane - just punching hole in the area > which is accessed via mmap could race in a bad way AFAICS. Seems the simple answer to me is to prevent page faults while hole punching, then.... Cheers, Dave. -- Dave Chinner david@fromorbit.com _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx126.postini.com [74.125.245.126]) by kanga.kvack.org (Postfix) with SMTP id 2A7F36B0082 for ; Fri, 18 May 2012 06:12:28 -0400 (EDT) Date: Fri, 18 May 2012 20:12:10 +1000 From: Dave Chinner Subject: Re: Hole punching and mmap races Message-ID: <20120518101210.GX25351@dastard> References: <20120515224805.GA25577@quack.suse.cz> <20120516021423.GO25351@dastard> <20120516130445.GA27661@quack.suse.cz> <20120517074308.GQ25351@dastard> <20120517232829.GA31028@quack.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120517232829.GA31028@quack.suse.cz> Sender: owner-linux-mm@kvack.org List-ID: To: Jan Kara Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, Hugh Dickins , linux-mm@kvack.org On Fri, May 18, 2012 at 01:28:29AM +0200, Jan Kara wrote: > On Thu 17-05-12 17:43:08, Dave Chinner wrote: > > On Wed, May 16, 2012 at 03:04:45PM +0200, Jan Kara wrote: > > > On Wed 16-05-12 12:14:23, Dave Chinner wrote: > > IIRC, it's a rare case (that I consider insane, BTW): read from a > > file with into a buffer that is a mmap()d region of the same file > > that has not been faulted in yet..... > With punch hole, the race is less insane - just punching hole in the area > which is accessed via mmap could race in a bad way AFAICS. Seems the simple answer to me is to prevent page faults while hole punching, then.... Cheers, Dave. -- Dave Chinner david@fromorbit.com -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org