Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/ryusuke/nilfs2

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2:
  nilfs2: fix imperfect completion wait in nilfs_wait_on_logs
  nilfs2: fix hang-up of cleaner after log writer returned with error
  nilfs2: fix duplicate call to nilfs_segctor_cancel_freev
  • Loading branch information
torvalds committed Mar 26, 2010
2 parents 6f063ae + d067633 commit e4d5042
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
8 changes: 4 additions & 4 deletions fs/nilfs2/segbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,14 @@ int nilfs_write_logs(struct list_head *logs, struct the_nilfs *nilfs)
int nilfs_wait_on_logs(struct list_head *logs)
{
struct nilfs_segment_buffer *segbuf;
int err;
int err, ret = 0;

list_for_each_entry(segbuf, logs, sb_list) {
err = nilfs_segbuf_wait(segbuf);
if (err)
return err;
if (err && !ret)
ret = err;
}
return 0;
return ret;
}

/*
Expand Down
15 changes: 7 additions & 8 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 Expand Up @@ -1897,8 +1897,7 @@ static void nilfs_segctor_abort_construction(struct nilfs_sc_info *sci,

list_splice_tail_init(&sci->sc_write_logs, &logs);
ret = nilfs_wait_on_logs(&logs);
if (ret)
nilfs_abort_logs(&logs, NULL, sci->sc_super_root, ret);
nilfs_abort_logs(&logs, NULL, sci->sc_super_root, ret ? : err);

list_splice_tail_init(&sci->sc_segbufs, &logs);
nilfs_cancel_segusage(&logs, nilfs->ns_sufile);
Expand Down

0 comments on commit e4d5042

Please sign in to comment.