patch-2.1.122 linux/fs/hfs/file_hdr.c

Next file: linux/fs/hfs/mdb.c
Previous file: linux/fs/hfs/file_cap.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.121/linux/fs/hfs/file_hdr.c linux/fs/hfs/file_hdr.c
@@ -610,7 +610,7 @@
 			left = count;
 		}
 
-		copy_from_user(((char *)&meta) + pos, buf, left);
+		left -= copy_from_user(((char *)&meta) + pos, buf, left);
 		layout->magic   = hfs_get_nl(meta.magic);
 		layout->version = hfs_get_nl(meta.version);
 		layout->entries = hfs_get_hs(meta.entries);
@@ -642,7 +642,7 @@
 			left = count;
 		}
 
-		copy_from_user(((char *)&meta) + pos, buf, left);
+		left -= copy_from_user(((char *)&meta) + pos, buf, left);
 		init_layout(layout, meta.descrs);
 
 		count -= left;
@@ -782,7 +782,7 @@
 
 		/* transfer the data from user space */
 		if (p) {
-			copy_from_user(p + offset, buf, left);
+			left -= copy_from_user(p + offset, buf, left);
 		} else if (fork) {
 			left = hfs_do_write(inode, fork, offset, buf, left);
 		}

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