Commit 14cbfee
ext4: correct the error path of ext4_write_inline_data_end()
[ Upstream commit 55ce2f6 ]
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.com
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent d7a15e1 commit 14cbfee
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 | | |
| |||
757 | 752 | | |
758 | 753 | | |
759 | 754 | | |
760 | | - | |
| 755 | + | |
761 | 756 | | |
762 | 757 | | |
763 | 758 | | |
| |||
766 | 761 | | |
767 | 762 | | |
768 | 763 | | |
769 | | - | |
| 764 | + | |
770 | 765 | | |
771 | 766 | | |
772 | 767 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1296 | 1296 | | |
1297 | 1297 | | |
1298 | 1298 | | |
| 1299 | + | |
1299 | 1300 | | |
1300 | 1301 | | |
1301 | 1302 | | |
| |||
1322 | 1323 | | |
1323 | 1324 | | |
1324 | 1325 | | |
| 1326 | + | |
1325 | 1327 | | |
1326 | 1328 | | |
1327 | 1329 | | |
1328 | 1330 | | |
1329 | 1331 | | |
1330 | 1332 | | |
1331 | | - | |
| 1333 | + | |
1332 | 1334 | | |
1333 | 1335 | | |
1334 | 1336 | | |
| |||
1411 | 1413 | | |
1412 | 1414 | | |
1413 | 1415 | | |
| 1416 | + | |
1414 | 1417 | | |
1415 | 1418 | | |
1416 | 1419 | | |
| |||
1440 | 1443 | | |
1441 | 1444 | | |
1442 | 1445 | | |
| 1446 | + | |
1443 | 1447 | | |
1444 | 1448 | | |
1445 | 1449 | | |
1446 | 1450 | | |
1447 | 1451 | | |
1448 | 1452 | | |
1449 | 1453 | | |
1450 | | - | |
1451 | 1454 | | |
1452 | 1455 | | |
1453 | 1456 | | |
| |||
0 commit comments