mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
Since mdevctl commit acf78c1ff6c9 it is now possible for the get-attributes event to occur between a pre-define and post-define. This is done in order to obtain the active attributes for the device before writing them to the config file, and implies that the get-attributes cannot re-obtain the file lock. For other cases where mdevctl calls get-attributes, the file lock is not already held and must be obtained by ap-check before reading attributes from active devices. To solve this, let's use the knowledge that mdevctl is a single-threaded tool and add a test to detect this scenario. If the file lock is already held by the parent during a get-attributes, don't attempt to re-acquire it. Reported-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>