summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorRoel Kluin <12o3l@tiscali.nl>2008-04-29 22:01:18 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-04-29 22:01:18 -0400
commitf8a87d89304c1eea8e4a8dc02d134f57590913c6 (patch)
tree9d1e5179573a77259c13161a245f7a761e4a5091 /fs
parent7c2f3d6f89aab04c5c66a0a757888d3a77a5e899 (diff)
downloadlinux-f8a87d89304c1eea8e4a8dc02d134f57590913c6.tar.gz
linux-f8a87d89304c1eea8e4a8dc02d134f57590913c6.tar.bz2
linux-f8a87d89304c1eea8e4a8dc02d134f57590913c6.zip
ext4: fix test ext_generic_write_end() copied return value
'copied' is unsigned, whereas 'ret2' is not. The test (copied < 0) fails Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/inode.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 0c94db462c2f..8d9707746413 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1311,10 +1311,11 @@ static int ext4_ordered_write_end(struct file *file,
new_i_size = pos + copied;
if (new_i_size > EXT4_I(inode)->i_disksize)
EXT4_I(inode)->i_disksize = new_i_size;
- copied = ext4_generic_write_end(file, mapping, pos, len, copied,
+ ret2 = ext4_generic_write_end(file, mapping, pos, len, copied,
page, fsdata);
- if (copied < 0)
- ret = copied;
+ copied = ret2;
+ if (ret2 < 0)
+ ret = ret2;
}
ret2 = ext4_journal_stop(handle);
if (!ret)
@@ -1339,10 +1340,11 @@ static int ext4_writeback_write_end(struct file *file,
if (new_i_size > EXT4_I(inode)->i_disksize)
EXT4_I(inode)->i_disksize = new_i_size;
- copied = ext4_generic_write_end(file, mapping, pos, len, copied,
+ ret2 = ext4_generic_write_end(file, mapping, pos, len, copied,
page, fsdata);
- if (copied < 0)
- ret = copied;
+ copied = ret2;
+ if (ret2 < 0)
+ ret = ret2;
ret2 = ext4_journal_stop(handle);
if (!ret)