Skip to contentSkip to conversation

Fix 32/64-bit bug in ext3

PATCH New Theodore Ts'o 1 participant 1 message Aug 4, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix 32/64-bit bug in ext3

The following patch fixes a 32/64-bit bug in ext3. We assign the number of bytes written to an int instead of a ssize_t, which causes the top 32-bits of the return value from write() to be lopped off. Please apply to 2.6.0-test tree. Thanks!!

- Ted

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.1595 -> 1.1596
# fs/ext3/file.c 1.13 -> 1.14
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/08/04 [email protected] 1.1596
# Fix 32/64-bit error in ext2_file_write; before, the top 32-bits of

# the return value was getting chopped off.
# --------------------------------------------
#
diff -Nru a/fs/ext3/file.c b/fs/ext3/file.c
--- a/fs/ext3/file.c	Mon Aug  4 14:46:41 2003
+++ b/fs/ext3/file.c	Mon Aug  4 14:46:41 2003
@@ -60,7 +60,8 @@
 {
 	struct file *file = iocb->ki_filp;
 	struct inode *inode = file->f_dentry->d_inode;
-	int ret, err;
+	ssize_t ret;
+	int err;

ret = generic_file_aio_write(iocb, buf, count, pos);