scoutfs: correctly set new flag in get_blocks

We weren't setting the new flag in the mapped buffer head.  This tells
the caller that the buffer is newly allocated and needs to be zeroed.
Without this we expose unwritten newly allocated block contents.

fsx found this almost immediately.  With this fixed fsx passes.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-10-18 15:15:03 -07:00
committed by Mark Fasheh
parent 20a22ddc6b
commit 0712ca6b9b

View File

@@ -1052,6 +1052,7 @@ static int scoutfs_get_block(struct inode *inode, sector_t iblock,
ret = find_alloc_block(sb, map, &key, ind, exists, lock);
if (ret)
goto out;
set_buffer_new(bh);
}
/* mark the bh mapped and set the size for as many contig as we see */
@@ -1063,7 +1064,6 @@ static int scoutfs_get_block(struct inode *inode, sector_t iblock,
map_bh(bh, inode->i_sb, map->blknos[ind]);
bh->b_size = min_t(u64, bh->b_size, i << SCOUTFS_BLOCK_SHIFT);
clear_buffer_new(bh);
}
ret = 0;