RE: [PATCH 2/6] scsi_dh : increment the refcounts while calling activate

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

 



> -----Original Message-----
> From: James Bottomley [mailto:James.Bottomley@xxxxxxx]
> Sent: Thursday, July 29, 2010 7:09 PM
> To: Moger, Babu
> Cc: device-mapper development; linux-scsi@xxxxxxxxxxxxxxx; Qi, Yanling;
> Chauhan, Vijay; Stankey, Robert; Dachepalli, Sudhir
> Subject: Re: [PATCH 2/6] scsi_dh : increment the refcounts while
> calling activate
> 
> On Wed, 2010-07-28 at 16:59 -0600, Moger, Babu wrote:
> > Hold the refcounts for device and scsi_dh_data while calling
> handler's
> > activate. This will make sure that devices and scsi_dh_data are not
> > removed while activate is still in progress. Make sure to call
> > put_device and kref_put in the handler after activate is complete.
> 
> This is a complete no-no.  You can't take unreleased references in a
> single patch.  I know the releases come in subsequent patches, but
> that's not the way to do it.  You have to have an atomic change (as in
> all refcounts must balance on either side of the patch).  If someone
> bisected into this, it would likely never release stuff ... which could
> lead to some unnecessary debugging.

  Yes.. Understood. Still investigating to see if I could avoid this..
 
> James
> 

��.n��������+%������w��{.n�����{������ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f



[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