From 0712ca6b9b7cbfe30e90d6e33bea3c65c629156b Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 18 Oct 2017 15:15:03 -0700 Subject: [PATCH] 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 --- kmod/src/data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmod/src/data.c b/kmod/src/data.c index 23a98eff..b101fc48 100644 --- a/kmod/src/data.c +++ b/kmod/src/data.c @@ -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;