----- Forwarded Message ----- From: "Stefan Hajnoczi" <stefanha@xxxxxxxxxx> To: "Eric Sandeen" <sandeen@xxxxxxxxxx> Cc: virt-devel@xxxxxxxxxx, "Kevin Wolf" <kwolf@xxxxxxxxxx> Sent: Friday, November 22, 2013 9:20:51 AM Subject: [virt-devel] btrfs NOCOW for VM disk images Hi, In upstream QEMU we're discussing patches that set the NOCOW flag on disk image files. We're told that this increases btrfs performance greatly since the file system will modify data in-place like ext4/xfs. During testing I found that the NOCOW flag prevents file cloning from working. cp --reflink fails with EINVAL when the source file has the NOCOW flag set. It is not possible to toggle NOCOW back and forth later on since it can only be set when no data has been allocated for the file yet. This leaves us with the choice between performance (NOCOW) and snapshots (default). Both are important for VM disk images! Questions: * Would it be possible to extend btrfs so that cp --reflink works on NOCOW files? (Clueless idea: quiesce I/O to the NOCOW file and clone it, then resume I/O and COW only writes to shared blocks.) * Does NOCOW prevent any other functionality besides file-level cloning? * Does NOCOW increase risk of data loss/corruption? (I guess yes since overwriting in place puts data at risk of power failure or drive failure.) Thanks, Stefan -- John Dulaney, RHCE IRC: handsome_pirate jdulaney.wordpress.com -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
