Re: [PATCH 2/5] rds: ib: replace spin_lock_irq with spin_lock_irqsave

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/11/17 6:33 PM, Yanjun Zhu wrote:
Sorry. I have no test case to show some issue.
But from Linux Kernel Development Second Edition by Robert Love.

Yes I know the book and what the API does :D

Use spin_lock_irq is dangerous since spin_unlock_irq unconditionally
enables interrupts.

We can assume the following scenario:

--->the interrupt is disabled.

        spin_lock_irq(lock_ptr);   <---this will disable interrupt again
        list_del(&ic->ib_node);
        spin_unlock_irq(lock_ptr); <---this will enable interrupt

---->the interrupt is enabled.

our code change the state of interrupt. This will make potential risk.
But spin_lock_irqsave/spin_unlock_irqrestore will not make potential risk.

ic is well protected for any possible race and hence I asked
if you had any test case. Please re-post the series again with
the subject patch dropper for Dave to pick it up.

Regards,
Santosh
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux