File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -777,6 +777,13 @@ int f2fs_write_inode(struct inode *inode, struct writeback_control *wbc)
777
777
!is_inode_flag_set (inode , FI_DIRTY_INODE ))
778
778
return 0 ;
779
779
780
+ /*
781
+ * no need to update inode page, ultimately f2fs_evict_inode() will
782
+ * clear dirty status of inode.
783
+ */
784
+ if (f2fs_cp_error (sbi ))
785
+ return - EIO ;
786
+
780
787
if (!f2fs_is_checkpoint_ready (sbi )) {
781
788
f2fs_mark_inode_dirty_sync (inode , true);
782
789
return - ENOSPC ;
Original file line number Diff line number Diff line change @@ -562,13 +562,16 @@ static inline bool has_curseg_enough_space(struct f2fs_sb_info *sbi,
562
562
unsigned int node_blocks , unsigned int data_blocks ,
563
563
unsigned int dent_blocks )
564
564
{
565
-
566
565
unsigned int segno , left_blocks , blocks ;
567
566
int i ;
568
567
569
568
/* check current data/node sections in the worst case. */
570
569
for (i = CURSEG_HOT_DATA ; i < NR_PERSISTENT_LOG ; i ++ ) {
571
570
segno = CURSEG_I (sbi , i )-> segno ;
571
+
572
+ if (unlikely (segno == NULL_SEGNO ))
573
+ return false;
574
+
572
575
left_blocks = CAP_BLKS_PER_SEC (sbi ) -
573
576
get_ckpt_valid_blocks (sbi , segno , true);
574
577
@@ -579,6 +582,10 @@ static inline bool has_curseg_enough_space(struct f2fs_sb_info *sbi,
579
582
580
583
/* check current data section for dentry blocks. */
581
584
segno = CURSEG_I (sbi , CURSEG_HOT_DATA )-> segno ;
585
+
586
+ if (unlikely (segno == NULL_SEGNO ))
587
+ return false;
588
+
582
589
left_blocks = CAP_BLKS_PER_SEC (sbi ) -
583
590
get_ckpt_valid_blocks (sbi , segno , true);
584
591
if (dent_blocks > left_blocks )
You can’t perform that action at this time.
0 commit comments