linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/3] mm: pagecache write deadlocks zerolength fix
@ 2006-11-30  7:20 Nick Piggin
  2006-11-30  7:22 ` [patch 2/3] mm: pagecache write deadlocks stale holes fix Nick Piggin
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Nick Piggin @ 2006-11-30  7:20 UTC (permalink / raw)
  To: Linux Kernel Mailing List, Andrew Morton, linux-fsdevel


writev with a zero-length segment is a noop, and we shouldn't return EFAULT.

Signed-off-by: Nick Piggin <npiggin@suse.de>

Index: linux-2.6/include/linux/pagemap.h
===================================================================
--- linux-2.6.orig/include/linux/pagemap.h
+++ linux-2.6/include/linux/pagemap.h
@@ -198,6 +198,9 @@ static inline int fault_in_pages_writeab
 {
 	int ret;
 
+	if (unlikely(size == 0))
+		return 0;
+
 	/*
 	 * Writing zeroes into userspace here is OK, because we know that if
 	 * the zero gets there, we'll be overwriting it.
@@ -222,6 +225,9 @@ static inline int fault_in_pages_readabl
 	volatile char c;
 	int ret;
 
+	if (unlikely(size == 0))
+		return 0;
+
 	ret = __get_user(c, uaddr);
 	if (ret == 0) {
 		const char __user *end = uaddr + size - 1;

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2006-12-02  9:43 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-30  7:20 [patch 1/3] mm: pagecache write deadlocks zerolength fix Nick Piggin
2006-11-30  7:22 ` [patch 2/3] mm: pagecache write deadlocks stale holes fix Nick Piggin
2006-11-30  7:22   ` [patch 3/3] fs: fix cont vs deadlock patches Nick Piggin
2006-11-30 11:32     ` Nick Piggin
2006-11-30 22:14       ` OGAWA Hirofumi
2006-12-01  0:27         ` Nick Piggin
2006-12-01  1:11           ` OGAWA Hirofumi
2006-12-01  2:03             ` Nick Piggin
2006-12-01  2:09         ` Nick Piggin
2006-12-01  3:41           ` OGAWA Hirofumi
2006-12-01  3:47             ` Nick Piggin
2006-12-01  5:08             ` Nick Piggin
2006-12-01  7:21               ` Andrew Morton
2006-12-01  7:53                 ` Nick Piggin
2006-12-01 14:50                   ` OGAWA Hirofumi
2006-12-01 15:47                     ` OGAWA Hirofumi
2006-12-02  0:36                     ` Nick Piggin
2006-12-02  7:28                       ` [new patch " Nick Piggin
2006-12-02  9:43                         ` OGAWA Hirofumi
2006-11-30  7:26 ` [patch 0/3] more buffered write fixes Nick Piggin
2006-11-30 10:15 ` [patch 1/3] mm: pagecache write deadlocks zerolength fix Andreas Schwab
2006-11-30 10:19   ` Nick Piggin
2006-11-30 10:30     ` Andreas Schwab
2006-11-30 11:30       ` Nick Piggin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).