f2fs: assign return value in f2fs_gc
authorJaegeuk Kim <jaegeuk@kernel.org>
Wed, 21 Sep 2016 16:28:06 +0000 (09:28 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sat, 1 Oct 2016 00:34:24 +0000 (17:34 -0700)
This patch adds a return value of write_checkpoint for f2fs_gc.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/gc.c

index 24acbbbd0b1dd56fa39dd6e9ffce49b4f751e12a..400bc6d78372237f69d77cc9df47c71d15a10666 100644 (file)
@@ -925,10 +925,14 @@ gc_more:
                 */
                if (__get_victim(sbi, &segno, gc_type) ||
                                                prefree_segments(sbi)) {
-                       write_checkpoint(sbi, &cpc);
+                       ret = write_checkpoint(sbi, &cpc);
+                       if (ret)
+                               goto stop;
                        segno = NULL_SEGNO;
                } else if (has_not_enough_free_secs(sbi, 0, 0)) {
-                       write_checkpoint(sbi, &cpc);
+                       ret = write_checkpoint(sbi, &cpc);
+                       if (ret)
+                               goto stop;
                }
        }
 
@@ -948,7 +952,7 @@ gc_more:
                        goto gc_more;
 
                if (gc_type == FG_GC)
-                       write_checkpoint(sbi, &cpc);
+                       ret = write_checkpoint(sbi, &cpc);
        }
 stop:
        mutex_unlock(&sbi->gc_mutex);