I suggest retaining the part where you use inflight l2metas to layout
data contiguously, but change alloc_cluster_link_l2() not to rely on
n_start and nb_available but instead recompute them on completion.
m->nb_clusters should never be zeroed for this to work.
Is there even a reason why we need to copy the unmodified sectors in
alloc_cluster_link_l2() and cannot do that in alloc_cluster_offset()
before we write the new data? Then the callback wouldn't need to mess
around with figuring out which part must be overwritten and which one
mustn't.