[dm-devel] [PATCH] md: fix bug due to nested suspend

NeilBrown neilb at suse.com
Wed Dec 16 03:57:01 UTC 2015


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?

Thanks,
NeilBrown
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20151216/7a3893d5/attachment.sig>


More information about the dm-devel mailing list