Re: PM/hibernate swapfile regression

From: Alan Jenkins
Date: Tue Jul 21 2009 - 06:50:44 EST


Heiko Carstens wrote:
> On Fri, Jul 17, 2009 at 02:08:46PM +0100, Alan Jenkins wrote:
>
>> Rafael J. Wysocki wrote:
>>
>>> On Tuesday 14 July 2009, Heiko Carstens wrote:
>>>
>>>
>>>> We've seen this bug [...]
>>>>
>>>> Looks like this was introduced with git commit a1bb7d61 "PM/hibernate: fix "swap
>>>> breaks after hibernation failures"".
>>>> Calling bdget while holding a spinlock doesn't seem to be a good idea...
>>>>
>>>>
>>> Agreed, sorry for missing that.
>>>
>>> Alan, can you please prepare a fix?
>>>
>> Here's a quick & dirty patch [...]
>>
>
> Thanks for the patch. Unfortunately Arnd was unable to reproduce the original
> behaviour. But your patch makes sense anyway.
> I also tested it and nothing broke. So should this go upstream?

I do want to fix it, but I think there's a better way.

It doesn't really need the sleeping bdget(). All we want is
atomic_inc(&bdev->bd_inode->i_count). I think we should call it bdcopy().

---------->