diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-27 01:14:29 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-27 01:14:29 +0300 |
commit | e4d50423d773fb8d5b714430ba5358e8a1b87c14 (patch) | |
tree | fc6f6bd830cb8b2a1a94734c35b18d0f2ac7ea8c /fs/nilfs2/segment.c | |
parent | 6f063aea557f66eea8c35034a25df85cae5ced33 (diff) | |
parent | d067633b4483f3c7d971d8f889f35340a8635bb5 (diff) | |
download | linux-e4d50423d773fb8d5b714430ba5358e8a1b87c14.tar.xz |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/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
Diffstat (limited to 'fs/nilfs2/segment.c')
-rw-r--r-- | fs/nilfs2/segment.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 69576a95e13f..c161d89061b5 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c @@ -1510,6 +1510,12 @@ 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, @@ -1517,12 +1523,6 @@ static int nilfs_segctor_collect(struct nilfs_sc_info *sci, 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; } @@ -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); |