summaryrefslogtreecommitdiffstats
path: root/fs/pnode.h
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@gmail.com>2014-02-20 21:15:25 +0000
committerJosef Bacik <jbacik@fb.com>2014-03-10 15:16:50 -0400
commit6baa4293af8abe95018e911c3df60ed5bfacc76f (patch)
tree53cfd63d1cf7e53ecc446b46916282e97139bd35 /fs/pnode.h
parent9dc442143b9874ba677fc83bf8c60744ec642998 (diff)
downloadlinux-6baa4293af8abe95018e911c3df60ed5bfacc76f.tar.gz
linux-6baa4293af8abe95018e911c3df60ed5bfacc76f.tar.bz2
linux-6baa4293af8abe95018e911c3df60ed5bfacc76f.zip
Btrfs: correctly determine if blocks are shared in btrfs_compare_trees
Just comparing the pointers (logical disk addresses) of the btree nodes is not completely bullet proof, we have to check if their generation numbers match too. It is guaranteed that a COW operation will result in a block with a different logical disk address than the original block's address, but over time we can reuse that former logical disk address. For example, creating a 2Gb filesystem on a loop device, and having a script running in a loop always updating the access timestamp of a file, resulted in the same logical disk address being reused for the same fs btree block in about only 4 minutes. This could make us skip entire subtrees when doing an incremental send (which is currently the only user of btrfs_compare_trees). However the odds of getting 2 blocks at the same tree level, with the same logical disk address, equal first slot keys and different generations, should hopefully be very low. Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com> Signed-off-by: Josef Bacik <jbacik@fb.com>
Diffstat (limited to 'fs/pnode.h')
0 files changed, 0 insertions, 0 deletions