Skip to content

Commit

Permalink
nilfs2: do not return io error for bio allocation failure
Browse files Browse the repository at this point in the history
Previously, log writer had possibility to set an io error flag on
segments even in case of memory allocation failure.

This fixes the issue.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
  • Loading branch information
Ryusuke Konishi committed Nov 29, 2009
1 parent 0935db7 commit 5f1586d
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions fs/nilfs2/segbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ int nilfs_segbuf_write(struct nilfs_segment_buffer *segbuf,
struct nilfs_write_info *wi)
{
struct buffer_head *bh;
int res, rw = WRITE;
int res = 0, rw = WRITE;

list_for_each_entry(bh, &segbuf->sb_segsum_buffers, b_assoc_buffers) {
res = nilfs_submit_bh(wi, bh, rw);
Expand All @@ -395,17 +395,10 @@ int nilfs_segbuf_write(struct nilfs_segment_buffer *segbuf,
*/
rw |= (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG);
res = nilfs_submit_seg_bio(wi, rw);
if (unlikely(res))
goto failed_bio;
}

res = 0;
out:
return res;

failed_bio:
atomic_inc(&wi->err);
goto out;
return res;
}

/**
Expand Down

0 comments on commit 5f1586d

Please sign in to comment.