Commit 7c2f3d6f89aab04c5c66a0a757888d3a77a5e899
Committed by
Theodore Ts'o
1 parent
8f6e39a7ad
Exists in
master
and in
7 other branches
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: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Showing 1 changed file with 8 additions and 6 deletions Side-by-side Diff
fs/ext3/inode.c
... | ... | @@ -1261,10 +1261,11 @@ |
1261 | 1261 | new_i_size = pos + copied; |
1262 | 1262 | if (new_i_size > EXT3_I(inode)->i_disksize) |
1263 | 1263 | EXT3_I(inode)->i_disksize = new_i_size; |
1264 | - copied = ext3_generic_write_end(file, mapping, pos, len, copied, | |
1264 | + ret2 = ext3_generic_write_end(file, mapping, pos, len, copied, | |
1265 | 1265 | page, fsdata); |
1266 | - if (copied < 0) | |
1267 | - ret = copied; | |
1266 | + copied = ret2; | |
1267 | + if (ret2 < 0) | |
1268 | + ret = ret2; | |
1268 | 1269 | } |
1269 | 1270 | ret2 = ext3_journal_stop(handle); |
1270 | 1271 | if (!ret) |
1271 | 1272 | |
... | ... | @@ -1289,10 +1290,11 @@ |
1289 | 1290 | if (new_i_size > EXT3_I(inode)->i_disksize) |
1290 | 1291 | EXT3_I(inode)->i_disksize = new_i_size; |
1291 | 1292 | |
1292 | - copied = ext3_generic_write_end(file, mapping, pos, len, copied, | |
1293 | + ret2 = ext3_generic_write_end(file, mapping, pos, len, copied, | |
1293 | 1294 | page, fsdata); |
1294 | - if (copied < 0) | |
1295 | - ret = copied; | |
1295 | + copied = ret2; | |
1296 | + if (ret2 < 0) | |
1297 | + ret = ret2; | |
1296 | 1298 | |
1297 | 1299 | ret2 = ext3_journal_stop(handle); |
1298 | 1300 | if (!ret) |