Commit 7c2f3d6f authored by Roel Kluin's avatar Roel Kluin Committed by Theodore Ts'o

ext3: fix test ext_generic_write_end() copied return value

'copied' is unsigned, whereas 'ret2' is not. The test (copied < 0) fails
Signed-off-by: default avatarRoel Kluin <12o3l@tiscali.nl>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 8f6e39a7
...@@ -1261,10 +1261,11 @@ static int ext3_ordered_write_end(struct file *file, ...@@ -1261,10 +1261,11 @@ static int ext3_ordered_write_end(struct file *file,
new_i_size = pos + copied; new_i_size = pos + copied;
if (new_i_size > EXT3_I(inode)->i_disksize) if (new_i_size > EXT3_I(inode)->i_disksize)
EXT3_I(inode)->i_disksize = new_i_size; EXT3_I(inode)->i_disksize = new_i_size;
copied = ext3_generic_write_end(file, mapping, pos, len, copied, ret2 = ext3_generic_write_end(file, mapping, pos, len, copied,
page, fsdata); page, fsdata);
if (copied < 0) copied = ret2;
ret = copied; if (ret2 < 0)
ret = ret2;
} }
ret2 = ext3_journal_stop(handle); ret2 = ext3_journal_stop(handle);
if (!ret) if (!ret)
...@@ -1289,10 +1290,11 @@ static int ext3_writeback_write_end(struct file *file, ...@@ -1289,10 +1290,11 @@ static int ext3_writeback_write_end(struct file *file,
if (new_i_size > EXT3_I(inode)->i_disksize) if (new_i_size > EXT3_I(inode)->i_disksize)
EXT3_I(inode)->i_disksize = new_i_size; EXT3_I(inode)->i_disksize = new_i_size;
copied = ext3_generic_write_end(file, mapping, pos, len, copied, ret2 = ext3_generic_write_end(file, mapping, pos, len, copied,
page, fsdata); page, fsdata);
if (copied < 0) copied = ret2;
ret = copied; if (ret2 < 0)
ret = ret2;
ret2 = ext3_journal_stop(handle); ret2 = ext3_journal_stop(handle);
if (!ret) if (!ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment