Skip to content

Commit

Permalink
f2fs: avoid to return incorrect errno of read_normal_summaries
Browse files Browse the repository at this point in the history
We should return error number of read_normal_summaries instead of -EINVAL when
read_normal_summaries failed.

Signed-off-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
  • Loading branch information
chaseyu authored and Jaegeuk Kim committed Mar 18, 2014
1 parent 4bc8e9b commit e4fc5fb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions fs/f2fs/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,7 @@ static int read_normal_summaries(struct f2fs_sb_info *sbi, int type)
static int restore_curseg_summaries(struct f2fs_sb_info *sbi)
{
int type = CURSEG_HOT_DATA;
int err;

if (is_set_ckpt_flags(F2FS_CKPT(sbi), CP_COMPACT_SUM_FLAG)) {
/* restore for compacted data summary */
Expand All @@ -1194,9 +1195,12 @@ static int restore_curseg_summaries(struct f2fs_sb_info *sbi)
type = CURSEG_HOT_NODE;
}

for (; type <= CURSEG_COLD_NODE; type++)
if (read_normal_summaries(sbi, type))
return -EINVAL;
for (; type <= CURSEG_COLD_NODE; type++) {
err = read_normal_summaries(sbi, type);
if (err)
return err;
}

return 0;
}

Expand Down

0 comments on commit e4fc5fb

Please sign in to comment.