Skip to content

Commit

Permalink
nilfs2: fix duplicate call to nilfs_segctor_cancel_freev
Browse files Browse the repository at this point in the history
Andreas Beckmann gave me a report that nilfs logged the following
warnings when it got a disk full:

  nilfs_sufile_do_cancel_free: segment 0 must be clean
  nilfs_sufile_do_cancel_free: segment 1 must be clean

These arise from a duplicate call to nilfs_segctor_cancel_freev in an
error path of log writer.  This will fix the issue.

Reported-by: Andreas Beckmann <debian@abeckmann.de>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
  • Loading branch information
Ryusuke Konishi committed Mar 22, 2010
1 parent 220bf99 commit 2d8428a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fs/nilfs2/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -1510,19 +1510,19 @@ static int nilfs_segctor_collect(struct nilfs_sc_info *sci,
if (mode != SC_LSEG_SR || sci->sc_stage.scnt < NILFS_ST_CPFILE)
break;

nilfs_clear_logs(&sci->sc_segbufs);

err = nilfs_segctor_extend_segments(sci, nilfs, nadd);
if (unlikely(err))
return err;

if (sci->sc_stage.flags & NILFS_CF_SUFREED) {
err = nilfs_sufile_cancel_freev(nilfs->ns_sufile,
sci->sc_freesegs,
sci->sc_nfreesegs,
NULL);
WARN_ON(err); /* do not happen */
}
nilfs_clear_logs(&sci->sc_segbufs);

err = nilfs_segctor_extend_segments(sci, nilfs, nadd);
if (unlikely(err))
return err;

nadd = min_t(int, nadd << 1, SC_MAX_SEGDELTA);
sci->sc_stage = prev_stage;
}
Expand Down

0 comments on commit 2d8428a

Please sign in to comment.