> From: Denis V. Lunev <[email protected]> > > An allocating pio requests the preallocation of the top delta ahead of > itself and does not wait when its cluster already fits, so the > allocator can still be working when submission is suspended or the > device is dm suspended. It looks up the top delta without a lock and > keeps the pointer and the file across its truncate or fallocate, while > a cmd rewrites deltas[] under neither of its locks: > > - merge and notify_merged_backward move the top delta one slot down and > zero the old slot. The allocator then reads a zero file_size from it > and truncates the live top image down to the preallocation size, or > reads a NULL file and oopses; > > - flip_upper_deltas swaps the two upper slots of a dm suspended device. > The allocator computes the new length from the size of the delta now > on top and truncates the old top one, now holding data below it, to > that length. > > Wait for the allocator to finish in ploop_suspend_submitting_pios() > after the inflight pios are gone, and in ploop_postsuspend() before > the device is marked suspended, which is what the flip checks. No pio > can request a new preallocation at either point. Wake the waiters with > wake_up(), as the one in ploop_postsuspend() sleeps uninterruptibly. > > Fixes: cf489cf22cd5 ("dm-ploop: make filespace preallocations async") > Reported-by: Konstantin Khorenko <[email protected]> > https://virtuozzo.atlassian.net/browse/VSTOR-152984 > Feature: dm-ploop: ploop target driver > Signed-off-by: Denis V. Lunev <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great! -- Sashiko AI review ยท https://sashiko.vzint.dev/#/patchset/[email protected]?part=3 _______________________________________________ Devel mailing list [email protected] https://lists.openvz.org/mailman/listinfo/devel
