Skip to content

Commit

Permalink
ext4: fix test ext_generic_write_end() copied return value
Browse files Browse the repository at this point in the history
'copied' is unsigned, whereas 'ret2' is not. The test (copied < 0) fails

Signed-off-by: Roel Kluin <[email protected]>
Signed-off-by: Mingming Cao <[email protected]>
Signed-off-by: "Theodore Ts'o" <[email protected]>
  • Loading branch information
Roel Kluin authored and tytso committed Apr 30, 2008
1 parent 7c2f3d6 commit f8a87d8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit f8a87d8

Please sign in to comment.