mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 03:10:12 +00:00
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>
This commit is contained in:
parent
7c2f3d6f89
commit
f8a87d8930
1 changed files with 8 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue