diff options
Diffstat (limited to 'fs/nilfs2/gcinode.c')
-rw-r--r-- | fs/nilfs2/gcinode.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/nilfs2/gcinode.c b/fs/nilfs2/gcinode.c index 145f03cd7d3e..bed3a783129b 100644 --- a/fs/nilfs2/gcinode.c +++ b/fs/nilfs2/gcinode.c | |||
@@ -48,6 +48,8 @@ | |||
48 | #include <linux/slab.h> | 48 | #include <linux/slab.h> |
49 | #include <linux/swap.h> | 49 | #include <linux/swap.h> |
50 | #include "nilfs.h" | 50 | #include "nilfs.h" |
51 | #include "btree.h" | ||
52 | #include "btnode.h" | ||
51 | #include "page.h" | 53 | #include "page.h" |
52 | #include "mdt.h" | 54 | #include "mdt.h" |
53 | #include "dat.h" | 55 | #include "dat.h" |
@@ -149,8 +151,10 @@ int nilfs_gccache_submit_read_data(struct inode *inode, sector_t blkoff, | |||
149 | int nilfs_gccache_submit_read_node(struct inode *inode, sector_t pbn, | 151 | int nilfs_gccache_submit_read_node(struct inode *inode, sector_t pbn, |
150 | __u64 vbn, struct buffer_head **out_bh) | 152 | __u64 vbn, struct buffer_head **out_bh) |
151 | { | 153 | { |
152 | int ret = nilfs_btnode_submit_block(&NILFS_I(inode)->i_btnode_cache, | 154 | int ret; |
153 | vbn ? : pbn, pbn, out_bh); | 155 | |
156 | ret = nilfs_btnode_submit_block(&NILFS_I(inode)->i_btnode_cache, | ||
157 | vbn ? : pbn, pbn, READ, out_bh, &pbn); | ||
154 | if (ret == -EEXIST) /* internal code (cache hit) */ | 158 | if (ret == -EEXIST) /* internal code (cache hit) */ |
155 | ret = 0; | 159 | ret = 0; |
156 | return ret; | 160 | return ret; |
@@ -164,10 +168,15 @@ int nilfs_gccache_wait_and_mark_dirty(struct buffer_head *bh) | |||
164 | if (buffer_dirty(bh)) | 168 | if (buffer_dirty(bh)) |
165 | return -EEXIST; | 169 | return -EEXIST; |
166 | 170 | ||
167 | if (buffer_nilfs_node(bh)) | 171 | if (buffer_nilfs_node(bh)) { |
172 | if (nilfs_btree_broken_node_block(bh)) { | ||
173 | clear_buffer_uptodate(bh); | ||
174 | return -EIO; | ||
175 | } | ||
168 | nilfs_btnode_mark_dirty(bh); | 176 | nilfs_btnode_mark_dirty(bh); |
169 | else | 177 | } else { |
170 | nilfs_mdt_mark_buffer_dirty(bh); | 178 | nilfs_mdt_mark_buffer_dirty(bh); |
179 | } | ||
171 | return 0; | 180 | return 0; |
172 | } | 181 | } |
173 | 182 | ||