Comment 17 for bug 1371591

Revision history for this message
Chris J Arges (arges) wrote : Re: file not initialized to 0s under some conditions on VMWare

Ok my experiment doing the following (and I know launchpad will mangle my spacing...):

diff --git a/block/blk-lib.c b/block/blk-lib.c
index 9b5b561..03ad981 100644
--- a/block/blk-lib.c
+++ b/block/blk-lib.c
@@ -283,6 +283,7 @@ int __blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
 int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
                         sector_t nr_sects, gfp_t gfp_mask)
 {
+#if 0
        if (bdev_write_same(bdev)) {
                unsigned char bdn[BDEVNAME_SIZE];

@@ -293,7 +294,7 @@ int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
                bdevname(bdev, bdn);
                pr_err("%s: WRITE SAME failed. Manually zeroing.\n", bdn);
        }
-
+#endif
        return __blkdev_issue_zeroout(bdev, sector, nr_sects, gfp_mask);
 }
 EXPORT_SYMBOL(blkdev_issue_zeroout);

Forcing manual zeroout works fine, so the 'hardware' zeroout is the problem.