Commit 71e9fec
Jaegeuk Kim
f2fs: invalidate the node page if allocation is failed
The new_node_page() is processed as the following procedure.
1. A new node page is allocated.
2. Set PageUptodate with proper footer information.
3. Check if there is a free space for allocation
4.a. If there is no space, f2fs returns with -ENOSPC.
4.b. Otherwise, go next.
In the case of step #4.a, f2fs remains a wrong node page in the page cache
with the uptodate flag.
Also, even though a new node page is allocated successfully, an error can be
occurred afterwards due to allocation failure of the other data structures.
In such a case, remove_inode_page() would be triggered, so that we have to
clear uptodate flag in truncate_node() too.
So, we should remove the uptodate flag, if allocation is failed.
Signed-off-by: Jaegeuk Kim <[email protected]>1 parent 690e4a3 commit 71e9fec
1 file changed
+12
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
487 | 491 | | |
488 | 492 | | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | 493 | | |
| 494 | + | |
493 | 495 | | |
494 | 496 | | |
495 | 497 | | |
| |||
499 | 501 | | |
500 | 502 | | |
501 | 503 | | |
502 | | - | |
| 504 | + | |
503 | 505 | | |
504 | 506 | | |
505 | 507 | | |
| |||
768 | 770 | | |
769 | 771 | | |
770 | 772 | | |
771 | | - | |
772 | | - | |
773 | | - | |
774 | | - | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | 773 | | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
785 | 779 | | |
786 | 780 | | |
787 | 781 | | |
| |||
845 | 839 | | |
846 | 840 | | |
847 | 841 | | |
| 842 | + | |
848 | 843 | | |
849 | 844 | | |
850 | 845 | | |
| |||
0 commit comments