diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 70a3b66011bf..63538f016192 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -2717,6 +2717,7 @@ find_other_zone: MAIN_SECS(sbi)); if (secno >= MAIN_SECS(sbi)) { ret = -ENOSPC; + f2fs_bug_on(sbi, 1); goto out_unlock; } } @@ -2727,6 +2728,7 @@ find_other_zone: MAIN_SECS(sbi)); if (secno >= MAIN_SECS(sbi)) { ret = -ENOSPC; + f2fs_bug_on(sbi, 1); goto out_unlock; } } @@ -2761,10 +2763,8 @@ got_it: out_unlock: spin_unlock(&free_i->segmap_lock); - if (ret) { + if (ret) f2fs_stop_checkpoint(sbi, false, STOP_CP_REASON_NO_SEGMENT); - f2fs_bug_on(sbi, 1); - } return ret; }