On Wed, 16 Dec 2015, NeilBrown wrote: > On Thu, Nov 26 2015, Mikulas Patocka wrote: > > > The patch c7bfced9a6716ff66c9d61f934bb60af08d4688c committed to 4.4-rc > > causes crash in LVM test shell/lvchange-raid.sh. The kernel crashes with > > this BUG, the reason is that we attempt to suspend a device that is > > already suspended. See also > > https://bugzilla.redhat.com/show_bug.cgi?id=1283491 > > > > This patch fixes the bug by introducing functions mddev_nested_suspend and > > mddev_nested_resume that can be called when the device is already > > suspended. The number of calls to mddev_nested_suspend is kept in the > > variable mddev->suspended. > > Hi, > thanks for the report and patch. > > I think I would rather just make mddev_suspend() always nest. > It is always called under ->reconfig_mutex or some similar guarentee of > being single-threaded in dm-raid, so we don't need an atomic_t. > > Just > mddev_suspend() > if (mddev->suspended++) > return; > ...do the suspend. > > and > mddev_resume() > if (--mddev->suspended) > return; > ... to the resume > > Does that seem reasonable to you? Yes, it seems OK. Mikulas -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel