Changes in uspace/lib/ext4/libext4_extent.c [38542dc:bd5d4e1] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_extent.c
r38542dc rbd5d4e1 371 371 uint32_t *fblock) 372 372 { 373 int rc; 373 374 /* Compute bound defined by i-node size */ 374 375 uint64_t inode_size = … … 400 401 uint64_t child = ext4_extent_index_get_leaf(index); 401 402 402 if (block != NULL) 403 block_put(block); 404 405 int rc = block_get(&block, inode_ref->fs->device, child, 403 if (block != NULL) { 404 rc = block_put(block); 405 if (rc != EOK) 406 return rc; 407 } 408 409 rc = block_get(&block, inode_ref->fs->device, child, 406 410 BLOCK_FLAGS_NONE); 407 411 if (rc != EOK) … … 429 433 /* Cleanup */ 430 434 if (block != NULL) 431 block_put(block);432 433 return EOK;435 rc = block_put(block); 436 437 return rc; 434 438 } 435 439 … … 505 509 506 510 cleanup: 511 ; 512 513 int rc2 = EOK; 514 507 515 /* 508 516 * Put loaded blocks … … 510 518 */ 511 519 for (uint16_t i = 1; i < tmp_path->depth; ++i) { 512 if (tmp_path[i].block) 513 block_put(tmp_path[i].block); 520 if (tmp_path[i].block) { 521 rc2 = block_put(tmp_path[i].block); 522 if (rc == EOK && rc2 != EOK) 523 rc = rc2; 524 } 514 525 } 515 526 … … 594 605 return rc; 595 606 596 ext4_balloc_free_block(inode_ref, fblock); 597 598 return EOK; 607 return ext4_balloc_free_block(inode_ref, fblock); 599 608 } 600 609 … … 721 730 722 731 cleanup: 732 ; 733 734 int rc2 = EOK; 735 723 736 /* 724 737 * Put loaded blocks … … 726 739 */ 727 740 for (uint16_t i = 1; i <= path->depth; ++i) { 728 if (path[i].block) 729 block_put(path[i].block); 741 if (path[i].block) { 742 rc2 = block_put(path[i].block); 743 if (rc == EOK && rc2 != EOK) 744 rc = rc2; 745 } 730 746 } 731 747 … … 778 794 779 795 /* Put back not modified old block */ 780 block_put(path_ptr->block); 796 rc = block_put(path_ptr->block); 797 if (rc != EOK) { 798 ext4_balloc_free_block(inode_ref, fblock); 799 block_put(block); 800 return rc; 801 } 781 802 782 803 /* Initialize newly allocated block and remember it */ … … 1061 1082 1062 1083 finish: 1084 ; 1085 1086 int rc2 = EOK; 1087 1063 1088 /* Set return values */ 1064 1089 *iblock = new_block_idx; … … 1070 1095 */ 1071 1096 for (uint16_t i = 1; i <= path->depth; ++i) { 1072 if (path[i].block) 1073 block_put(path[i].block); 1097 if (path[i].block) { 1098 rc2 = block_put(path[i].block); 1099 if (rc == EOK && rc2 != EOK) 1100 rc = rc2; 1101 } 1074 1102 } 1075 1103
Note:
See TracChangeset
for help on using the changeset viewer.