Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

jfs: jump to error_out when filemap_{fdatawait, write_and_wait} fails

filemap_fdatawait/filemap_write_and_wait may fail, so check the return
value and jump to error_out in the case of error.

Signed-off-by: Quorum Laval <quorum.laval@gmail.com>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>

authored by

Quorum Laval and committed by
Dave Kleikamp
7cfcd8b7 b8927721

+8 -2
+8 -2
fs/jfs/resize.c
··· 379 379 * cached in meta-data cache, and not written out 380 380 * by txCommit(); 381 381 */ 382 - filemap_fdatawait(ipbmap->i_mapping); 383 - filemap_write_and_wait(ipbmap->i_mapping); 382 + rc = filemap_fdatawait(ipbmap->i_mapping); 383 + if (rc) 384 + goto error_out; 385 + 386 + rc = filemap_write_and_wait(ipbmap->i_mapping); 387 + if (rc) 388 + goto error_out; 389 + 384 390 diWriteSpecial(ipbmap, 0); 385 391 386 392 newPage = nPages; /* first new page number */