Dave, >> The answer is that it depends. It can return zeroes or a >> device-specific initialization pattern (oh joy). > > So they ignore the "write zeroes" part of the command? I'd have to look to see how ANCHOR and NDOB interact on a WRITE SAME. That's the closest thing SCSI has to WRITE ZEROES. You can check whether a device has a non-standard initialization pattern. It's a bit convoluted given that devices can autonomously transition blocks between different states based on the initialization pattern. But again, I don't think anybody has actually implemented this part of the spec. >> We have: >> >> Allocate and zero: FALLOC_FL_ZERO_RANGE >> Deallocate and zero: FALLOC_FL_PUNCH_HOLE >> Deallocate: FALLOC_FL_PUNCH_HOLE | FALLOC_FL_NO_HIDE_STALE >> but are missing: >> >> Allocate: FALLOC_FL_ZERO_RANGE | FALLOC_FL_NO_HIDE_STALE Copy and paste error. "Allocate:" would be FALLOC_FL_NO_HIDE_STALE in the ANCHOR case. It's really just a preallocation but the blocks could contain something other than zeroes depending on the device. > So we've defined the fallocate flags to have /completely/ different > behaviour on block devices to filesystems. Are you referring to the "Allocate" case or something else? From fallocate(2): "Specifying the FALLOC_FL_ZERO_RANGE flag [...] zeroes space [...]. Within the specified range, blocks are preallocated for the regions that span the holes in the file. After a successful call, subsequent reads from this range will return zeroes." "Specifying the FALLOC_FL_PUNCH_HOLE flag [...] deallocates space [...]. Within the specified range, partial filesystem blocks are zeroed, and whole filesystem blocks are removed from the file. After a successful call, subsequent reads from this range will return zeroes." That matches the block device behavior as far as I'm concerned. -- Martin K. Petersen Oracle Linux Engineering