nilfs2: do not return io error for bio allocation failure

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, December 11, 2009 - 1:59 pm

Gitweb:     http://git.kernel.org/linus/5f1586d0dd8f6eeecf6c0d35cbca6291afd6f1cc
Commit:     5f1586d0dd8f6eeecf6c0d35cbca6291afd6f1cc
Parent:     0935db747739782fc779eb58529610c12db88ea2
Author:     Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
AuthorDate: Sun Nov 29 19:14:17 2009 +0900
Committer:  Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
CommitDate: Sun Nov 29 19:59:00 2009 +0900

    nilfs2: do not return io error for bio allocation failure
    
    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 |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c
index e6d9e37..c71b689 100644
--- a/fs/nilfs2/segbuf.c
+++ b/fs/nilfs2/segbuf.c
@@ -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;
 }
 
 /**
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
nilfs2: do not return io error for bio allocation failure, Linux Kernel Mailing ..., (Fri Dec 11, 1:59 pm)