]> xenbits.xensource.com Git - xen.git/commit
xen/domain: Fix label position in domain_teardown()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 27 Aug 2021 13:46:52 +0000 (14:46 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 27 Aug 2021 14:12:05 +0000 (15:12 +0100)
commit8064488062641ae505b2a7369611c38057a7788b
treec2c4f46dbcea9f769c555f76f279db008abd01be
parentafab477fba3b4de4ad3887c27677737b96488091
xen/domain: Fix label position in domain_teardown()

As explained in the comments, a progress label wants to be before the function
it refers to for the higher level logic to make sense.  As it happens, the
effects are benign because gnttab_mappings is immediately adjacent to teardown
in terms of co-routine exit points.

There is and will always be a corner case with 0.  Help alleviate this
visually (at least slightly) with a BUILD_BUG_ON() to ensure the property
which makes this function do anything useful.

There is also a visual corner case when changing from PROGRESS() to
PROGRESS_VCPU().  The important detail is to check that there is a "return
rc;" logically between each PROGRESS*() marker.

Fixes: b1ee10be5625 ("gnttab: add preemption check to gnttab_release_mappings()")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/common/domain.c