Re: [PATCH] scsi: core: Fix the scsi_device_put() might_sleep annotation

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

 



On Thu, Jan 26, 2023 at 10:22:12PM -0500, Martin K. Petersen wrote:
> On Wed, 25 Jan 2023 11:43:11 -0800, Bart Van Assche wrote:
> 
> > Although most calls of scsi_device_put() happen from non-atomic context,
> > alua_rtpg_queue() calls this function from atomic context if
> > alua_rtpg_queue() itself is called from atomic context. alua_rtpg_queue()
> > is always called from contexts where the caller must hold at least one
> > reference to the scsi device in question. This means that the reference
> > taken by alua_rtpg_queue() itself can't be the last one, and thus can be
> > dropped without entering the code path in which scsi_device_put() might
> > actually sleep. Hence move the might_sleep() annotation from
> > scsi_device_put() into scsi_device_dev_release().
> > 
> > [...]
> 
> Applied to 6.2/scsi-fixes, thanks!

This is a really bad idea.  Instead of actually catching scsi_device_put
put from a wrong context all the time, it now limits to the final put
and thus making the annotation a lot less useful.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux