From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752223AbXBDIwq (ORCPT ); Sun, 4 Feb 2007 03:52:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752199AbXBDIuj (ORCPT ); Sun, 4 Feb 2007 03:50:39 -0500 Received: from mx2.suse.de ([195.135.220.15]:40973 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752191AbXBDIuc (ORCPT ); Sun, 4 Feb 2007 03:50:32 -0500 From: Nick Piggin To: Andrew Morton Cc: Linux Kernel , Linux Filesystems , Nick Piggin , Linux Memory Management Message-Id: <20070204063754.23659.28403.sendpatchset@linux.site> In-Reply-To: <20070204063707.23659.20741.sendpatchset@linux.site> References: <20070204063707.23659.20741.sendpatchset@linux.site> Subject: [patch 5/9] mm: debug write deadlocks Date: Sun, 4 Feb 2007 09:50:28 +0100 (CET) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Allow CONFIG_DEBUG_VM to switch off the prefaulting logic, to simulate the difficult race where the page may be unmapped before calling copy_from_user. Makes the race much easier to hit. This is useful for demonstration and testing purposes, but is removed in a subsequent patch. Signed-off-by: Nick Piggin Index: linux-2.6/mm/filemap.c =================================================================== --- linux-2.6.orig/mm/filemap.c +++ linux-2.6/mm/filemap.c @@ -2103,6 +2103,7 @@ generic_file_buffered_write(struct kiocb if (maxlen > bytes) maxlen = bytes; +#ifndef CONFIG_DEBUG_VM /* * Bring in the user page that we will copy from _first_. * Otherwise there's a nasty deadlock on copying from the @@ -2110,6 +2111,7 @@ generic_file_buffered_write(struct kiocb * up-to-date. */ fault_in_pages_readable(buf, maxlen); +#endif page = __grab_cache_page(mapping,index,&cached_page,&lru_pvec); if (!page) {