[dm-devel] [PATCH] md: fix bug due to nested suspend
NeilBrown
neilb at suse.com
Thu Dec 17 04:09:51 UTC 2015
On Thu, Dec 17 2015, Mikulas Patocka wrote:
> 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
Thanks. I've revised your original patch to behave as above and will
send to Linus today or tomorrow.
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/20151217/e1d017f0/attachment.sig>
More information about the dm-devel
mailing list