Closed qiyuanzhi closed 7 months ago
it seems that only COW_OBJ_SIZE
(128K)is copyed to dest block. Is it a coding error ?
it seems that only
COW_OBJ_SIZE
(128K)is copyed to dest block. Is it a coding error ?
Yes, you are right. That's a bug. there need a loop to copy the whole entity object in IO size COW_OBJ_SIZE. Not copying the whole entiry object in single IO is to avoid so large an read/write have impact on normal IO.
This issue is fixed in commit: a82b6f7
The COW read/write IO was issued by a number of std::async tasks, not send to SSD thread.
I wonder is it necessary to post cow task to disk thread ? The two blocks(src & dest) were reserved currently, and no other IO will occur until we release them. So, i think cow on current thread is feasible.