nilfs2: do not return io error for bio allocation failure
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Sun, 29 Nov 2009 10:14:17 +0000 (19:14 +0900)
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Sun, 29 Nov 2009 10:59:00 +0000 (19:59 +0900)
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>
fs/nilfs2/segbuf.c

index e6d9e37fa241784c62400c0d4493185de97dd654..c71b689bdbce231f4635aec7ef0f0b41be2ad995 100644 (file)
@@ -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);
@@ -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;
 }
 
 /**