summaryrefslogtreecommitdiff
blob: 30bed5b3fb0e5ea2079c3cbe47e8103c2712955c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# ChangeSet
#   2005/01/04 15:57:25-08:00 brugolsky@telemetry-investments.com.
#   [PATCH] NFS client O_DIRECT error case fix
#
#   The NFS direct-io error return path for request sizes greater than
#   MAX_DIRECTIO_SIZE fails to initialize the returned page struct array
#   pointer to NULL.
#
#   Discovered using AKPM's ext3-tools: odwrite -ko 0 16385 foo
#
#   Signed-off-by: Bill Rugolsky <brugolsky@telemetry-investments.com>
#   Signed-off-by: Linus Torvalds <torvalds@osdl.org>
#
# fs/nfs/direct.c
#   2005/01/04 13:55:37-08:00 brugolsky@telemetry-investments.com +3 -1
#   NFS client O_DIRECT error case fix
#
diff -Nru linux-2.6.10/fs/nfs/direct.c linux-2.6.10.plasmaroo/fs/nfs/direct.c
--- linux-2.6.10/fs/nfs/direct.c	2005-01-11 21:28:34 +01:00
+++ linux-2.6.10.plasmaroo/fs/nfs/direct.c	2005-01-11 21:28:34 +01:00
@@ -73,7 +73,10 @@
 
 	/* set an arbitrary limit to prevent arithmetic overflow */
 	if (size > MAX_DIRECTIO_SIZE)
+	{
+		*pages = NULL;
 		return -EFBIG;
+	}
 
 	page_count = (user_addr + size + PAGE_SIZE - 1) >> PAGE_SHIFT;
 	page_count -= user_addr >> PAGE_SHIFT;