From owner-freebsd-scsi@FreeBSD.ORG Sat Mar 20 12:23:50 2010 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85DE01065670; Sat, 20 Mar 2010 12:23:50 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-iw0-f171.google.com (mail-iw0-f171.google.com [209.85.223.171]) by mx1.freebsd.org (Postfix) with ESMTP id 2A9F58FC13; Sat, 20 Mar 2010 12:23:50 +0000 (UTC) Received: by iwn1 with SMTP id 1so772154iwn.27 for ; Sat, 20 Mar 2010 05:23:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=n4hsVIvu/CvOil0jxpzBDC28GfUAJXqAstPMmxrmVjI=; b=xlRLzIJRpznZENywl7ZUCGSiFQAi9Gky4WjnomJGTa3gjnCflYlu87X6jpX7m4I59u 0KFwrEaQAxLO32Ia7QvezuoqhGxLraq5LQHmAO3Ii/SzzTe6hqclaqeBbonWfj97/YcI BSZ5iT0F/1RSMRXb3ZolqvuiZamwjZDbpLNBY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=J4VgO0fwI/CLQVa+wCdP5xt+Y3K+PdLPwAMsT+Ilncyve8FaX4gNwgL47ct1udpyjp +aA6GyBgWKp2PfC9Dyi4AtTvUjOL07NR8486KCwuW6vNSHXzKvBtvS1TeAlb1iOIDjyE rcBU2wKWjz/NQJfEZ4wtXnC+0iSCS5eL1GvEA= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.231.157.208 with SMTP id c16mr66998ibx.81.1269087829274; Sat, 20 Mar 2010 05:23:49 -0700 (PDT) In-Reply-To: <4B9A91DA.7030107@FreeBSD.org> References: <3bbf2fe11002281655i61a5f0a0if3f381ad0c4a1ef8@mail.gmail.com> <3bbf2fe11003031532u2207eb55h19c3a045215a7d84@mail.gmail.com> <4B8EF336.80107@feral.com> <3bbf2fe11003031547kd5f7314t3d83b2bde06c1c2f@mail.gmail.com> <4B8EF990.5030407@feral.com> <3bbf2fe11003031607wa3727b5ke89bc2a909d4d6a6@mail.gmail.com> <4B901419.8060800@feral.com> <3bbf2fe11003041737p30690522ya81e1b8f4bd6bbf9@mail.gmail.com> <3bbf2fe11003120601y3c403a1ct50f9fc6c1f0903bf@mail.gmail.com> <4B9A91DA.7030107@FreeBSD.org> Date: Sat, 20 Mar 2010 13:23:49 +0100 X-Google-Sender-Auth: 99783265dee31f85 Message-ID: <3bbf2fe11003200523t60895bfv1fa73d04e58a7838@mail.gmail.com> From: Attilio Rao To: Alexander Motin Content-Type: text/plain; charset=UTF-8 Cc: freebsd-scsi@freebsd.org, "Justin T. Gibbs" , mj@feral.com, Ed Maste Subject: Re: How is supposed to be protected the units list? X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Mar 2010 12:23:50 -0000 2010/3/12 Alexander Motin : > Attilio Rao wrote: >> 2010/3/5 Attilio Rao : >>> 2010/3/4 Matthew Jacob : >>>> The referred to patch at least got me out of panic case :-).. >>>> >>>> http://people.freebsd.org/~mjacob/scsi_da.c.patch >>> Yes, honestly the main intent of this patch is to offer a stable >>> ground for correct handling of periph. When looking about refcounting >>> them correctly, the main problem is that there was no initial >>> condition assuring safety, and the initial patch should address this, >>> but I'm sure there are places where periph refcount is not handled >>> correctly and this may be one. >> >> So, as long as it seems nobody had a strong argument against this >> patch, what do you think about me committing it? >> We can further refine later if we think it is the case. >> >> Also, I think that Matt's patch should be committed just after this >> one (and possibly we should investigate a similar add-on for the ata >> counterpart too?). > > I have already told my opinion, that second lock may be not needed. I > would like to think a bit more about both patches after getting back > from the conference. Thanks, So I made this new patch using the bus lock: http://www.freebsd.org/~attilio/Sandvine/pdrv/xpt_lock.diff I would have preferred to have a dedicated lock for the units lists, but as long as you seem having strong opionion, I'm fine with it. Maybe Matt wants to add his refcounting modifies using this scheme if we came to a consensous? Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein