Commit 55ce2f6
ext4: correct the error path of ext4_write_inline_data_end()
Current error path of ext4_write_inline_data_end() is not correct.
Firstly, it should pass out the error value if ext4_get_inode_loc()
return fail, or else it could trigger infinite loop if we inject error
here. And then it's better to add inode to orphan list if it return fail
in ext4_journal_stop(), otherwise we could not restore inline xattr
entry after power failure. Finally, we need to reset the 'ret' value if
ext4_write_inline_data_end() return success in ext4_write_end() and
ext4_journalled_write_end(), otherwise we could not get the error return
value of ext4_journal_stop().
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Link: https://lore.kernel.org/r/20210716122024.1105856-3-yi.zhang@huawei.com1 parent 4df031f commit 55ce2f6
2 files changed
Lines changed: 10 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
| 736 | + | |
| 737 | + | |
742 | 738 | | |
743 | 739 | | |
744 | 740 | | |
745 | 741 | | |
746 | | - | |
747 | | - | |
| 742 | + | |
748 | 743 | | |
749 | 744 | | |
750 | 745 | | |
751 | 746 | | |
752 | 747 | | |
753 | 748 | | |
754 | | - | |
| 749 | + | |
755 | 750 | | |
756 | 751 | | |
757 | 752 | | |
| |||
760 | 755 | | |
761 | 756 | | |
762 | 757 | | |
763 | | - | |
| 758 | + | |
764 | 759 | | |
765 | 760 | | |
766 | 761 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1295 | 1295 | | |
1296 | 1296 | | |
1297 | 1297 | | |
| 1298 | + | |
1298 | 1299 | | |
1299 | 1300 | | |
1300 | 1301 | | |
| |||
1321 | 1322 | | |
1322 | 1323 | | |
1323 | 1324 | | |
| 1325 | + | |
1324 | 1326 | | |
1325 | 1327 | | |
1326 | 1328 | | |
1327 | 1329 | | |
1328 | 1330 | | |
1329 | 1331 | | |
1330 | | - | |
| 1332 | + | |
1331 | 1333 | | |
1332 | 1334 | | |
1333 | 1335 | | |
| |||
1410 | 1412 | | |
1411 | 1413 | | |
1412 | 1414 | | |
| 1415 | + | |
1413 | 1416 | | |
1414 | 1417 | | |
1415 | 1418 | | |
| |||
1439 | 1442 | | |
1440 | 1443 | | |
1441 | 1444 | | |
| 1445 | + | |
1442 | 1446 | | |
1443 | 1447 | | |
1444 | 1448 | | |
1445 | 1449 | | |
1446 | 1450 | | |
1447 | 1451 | | |
1448 | 1452 | | |
1449 | | - | |
1450 | 1453 | | |
1451 | 1454 | | |
1452 | 1455 | | |
| |||
0 commit comments