diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-02-09 13:34:38 -0500 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-02-11 20:04:47 -0500 |
commit | da17eece035d72cb50d48529744a490784f29d2f (patch) | |
tree | c1dac57816c10f09ca7c97757c8350ab47b71348 /fs/f2fs | |
parent | aaf9607516ed38825268515ef4d773289a44f429 (diff) |
f2fs: call set_buffer_new for get_block
This patch fixes wrong handling of buffer_new flag in get_block.
If f2fs allocates new blocks and mapped buffer_head, it needs to set buffer_new
for the bh_result.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/data.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index d166557ca867..26e247697e58 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -274,7 +274,7 @@ static int check_extent_cache(struct inode *inode, pgoff_t pgofs, | |||
274 | unsigned int blkbits = inode->i_sb->s_blocksize_bits; | 274 | unsigned int blkbits = inode->i_sb->s_blocksize_bits; |
275 | size_t count; | 275 | size_t count; |
276 | 276 | ||
277 | clear_buffer_new(bh_result); | 277 | set_buffer_new(bh_result); |
278 | map_bh(bh_result, inode->i_sb, | 278 | map_bh(bh_result, inode->i_sb, |
279 | start_blkaddr + pgofs - start_fofs); | 279 | start_blkaddr + pgofs - start_fofs); |
280 | count = end_fofs - pgofs + 1; | 280 | count = end_fofs - pgofs + 1; |
@@ -634,12 +634,14 @@ static int __get_data_block(struct inode *inode, sector_t iblock, | |||
634 | goto put_out; | 634 | goto put_out; |
635 | 635 | ||
636 | if (dn.data_blkaddr != NULL_ADDR) { | 636 | if (dn.data_blkaddr != NULL_ADDR) { |
637 | set_buffer_new(bh_result); | ||
637 | map_bh(bh_result, inode->i_sb, dn.data_blkaddr); | 638 | map_bh(bh_result, inode->i_sb, dn.data_blkaddr); |
638 | } else if (create) { | 639 | } else if (create) { |
639 | err = __allocate_data_block(&dn); | 640 | err = __allocate_data_block(&dn); |
640 | if (err) | 641 | if (err) |
641 | goto put_out; | 642 | goto put_out; |
642 | allocated = true; | 643 | allocated = true; |
644 | set_buffer_new(bh_result); | ||
643 | map_bh(bh_result, inode->i_sb, dn.data_blkaddr); | 645 | map_bh(bh_result, inode->i_sb, dn.data_blkaddr); |
644 | } else { | 646 | } else { |
645 | goto put_out; | 647 | goto put_out; |