diff options
author | Nick Piggin <npiggin@suse.de> | 2007-10-16 04:24:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:42:54 -0400 |
commit | 5fe172370687e03cc6ba8dca990b75db18ff9bb3 (patch) | |
tree | 8ce000fee15fa9ccd4313018f7f9ab1ffbc8cdaa | |
parent | ae37461c70bc8c8416cad1bab13a9898ed030aa1 (diff) |
mm: debug write deadlocks
Allow CONFIG_DEBUG_VM to switch off the prefaulting logic, to simulate the
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 <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/filemap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index f74d05201862..0c54fc9b8e3d 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -1878,6 +1878,7 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov, | |||
1878 | if (maxlen > bytes) | 1878 | if (maxlen > bytes) |
1879 | maxlen = bytes; | 1879 | maxlen = bytes; |
1880 | 1880 | ||
1881 | #ifndef CONFIG_DEBUG_VM | ||
1881 | /* | 1882 | /* |
1882 | * Bring in the user page that we will copy from _first_. | 1883 | * Bring in the user page that we will copy from _first_. |
1883 | * Otherwise there's a nasty deadlock on copying from the | 1884 | * Otherwise there's a nasty deadlock on copying from the |
@@ -1885,6 +1886,7 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov, | |||
1885 | * up-to-date. | 1886 | * up-to-date. |
1886 | */ | 1887 | */ |
1887 | fault_in_pages_readable(buf, maxlen); | 1888 | fault_in_pages_readable(buf, maxlen); |
1889 | #endif | ||
1888 | 1890 | ||
1889 | page = __grab_cache_page(mapping,index,&cached_page,&lru_pvec); | 1891 | page = __grab_cache_page(mapping,index,&cached_page,&lru_pvec); |
1890 | if (!page) { | 1892 | if (!page) { |