[PATCH] Handle partial read or write.