From mboxrd@z Thu Jan 1 00:00:00 1970 From: KOSAKI Motohiro Subject: Re: Corruption with O_DIRECT and unaligned user buffers Date: Fri, 19 Dec 2008 21:14:31 +0900 (JST) Message-ID: <20081219210242.ECC4.KOSAKI.MOTOHIRO@jp.fujitsu.com> References: <20081218152952.GW24856@random.random> <494B8AD5.3090901@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Cc: kosaki.motohiro@jp.fujitsu.com, Andrea Arcangeli , Nick Piggin , Tim LaBerge , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Wang Chen To: Li Zefan Return-path: Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:60034 "EHLO fgwmail7.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752126AbYLSMOg (ORCPT ); Fri, 19 Dec 2008 07:14:36 -0500 Received: from m5.gw.fujitsu.co.jp ([10.0.50.75]) by fgwmail7.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id mBJCEYPp001030 for (envelope-from kosaki.motohiro@jp.fujitsu.com); Fri, 19 Dec 2008 21:14:34 +0900 Received: from smail (m5 [127.0.0.1]) by outgoing.m5.gw.fujitsu.co.jp (Postfix) with ESMTP id CAD1545DE51 for ; Fri, 19 Dec 2008 21:14:33 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (s5.gw.fujitsu.co.jp [10.0.50.95]) by m5.gw.fujitsu.co.jp (Postfix) with ESMTP id A532D45DE4F for ; Fri, 19 Dec 2008 21:14:33 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id DE8641DB8041 for ; Fri, 19 Dec 2008 21:14:32 +0900 (JST) Received: from m108.s.css.fujitsu.com (m108.s.css.fujitsu.com [10.249.87.108]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id 9C51F1DB803E for ; Fri, 19 Dec 2008 21:14:32 +0900 (JST) In-Reply-To: <494B8AD5.3090901@cn.fujitsu.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: > > diff -ur rhel-5.2/kernel/fork.c x/kernel/fork.c > > --- rhel-5.2/kernel/fork.c 2008-07-10 17:26:43.000000000 +0200 > > +++ x/kernel/fork.c 2008-12-18 15:57:31.000000000 +0100 > > @@ -368,7 +368,7 @@ > > rb_parent = &tmp->vm_rb; > > > > mm->map_count++; > > - retval = copy_page_range(mm, oldmm, mpnt); > > + retval = copy_page_range(mm, oldmm, tmp); > > > > Could you explain a bit why this change is needed? maybe.. __handle_mm_fault() change rmap of passwd vma. we need to parent process has original page, child process has new page. then we need child vma. > Seems this is a revert of the following commit: > > commit 0b0db14c536debd92328819fe6c51a49717e8440 > Author: Hugh Dickins > Date: Mon Nov 21 21:32:20 2005 -0800 > > [PATCH] unpaged: copy_page_range vma > > For copy_one_pte's print_bad_pte to show the task correctly (instead of > "???"), dup_mmap must pass down parent vma rather than child vma. I think you are right. This patch reintroduce the same problem. end up, print_bad_pte() need parent vma. __handle_mm_fault() need child vma. corrent?