patch-2.2.0-pre1 linux/fs/fat/file.c

Next file: linux/fs/fat/inode.c
Previous file: linux/fs/devices.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.132/linux/fs/fat/file.c linux/fs/fat/file.c
@@ -375,6 +375,12 @@
 		*ppos = inode->i_size;
 	if (count == 0)
 		return 0;
+	if (*ppos + count > 0x7FFFFFFFLL) {
+		count = 0x7FFFFFFFLL-*ppos;
+		if (!count)
+			return -EFBIG;
+	}
+
 	error = carry = 0;
 	for (start = buf; count || carry; count -= size) {
 		while (!(sector = fat_smap(inode,*ppos >> SECTOR_BITS)))

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov