From owner-freebsd-scsi@FreeBSD.ORG Tue Mar 2 15:24:48 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 1298C1065675; Tue, 2 Mar 2010 15:24:48 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-qy0-f194.google.com (mail-qy0-f194.google.com [209.85.221.194]) by mx1.freebsd.org (Postfix) with ESMTP id ACD318FC16; Tue, 2 Mar 2010 15:24:47 +0000 (UTC) Received: by qyk32 with SMTP id 32so172387qyk.28 for ; Tue, 02 Mar 2010 07:24:40 -0800 (PST) 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=85HyREaHgbEx8LGd/Me/aEEaw9fMOXQbVnwQJl7y5O4=; b=m3v0NpmfoEzT5Q1sl/E7I7QRwRidQZ1tRWTisIyRjjUePCEx+5M6mZfR41wH+wAcT2 XYedLkXkTDLUR8ADL8jgoPT4VaoJGnGYIJefTtApdiCivtuwPcwJZC3bXfUeySqrIuQf phW7V9n0jq8suJQr14sIyL6nrE45w/k0sGF24= 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=YoIEtiHdzCQAYgysdxhmAN/9blA1iwmyZixISbb7xWc+F+wgqOjeNCI0TlsVd6oEf5 aG/1hACa99JKz75l6R1VG6y+tCAAcY8cAoSvHvdx0fkmcxpE5oOVpI2sktCxElJN3mQg CNTXf2K17AvLQzLOgMFE/fiwfo8ARxOzNXEnU= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.224.66.129 with SMTP id n1mr3365577qai.220.1267543479689; Tue, 02 Mar 2010 07:24:39 -0800 (PST) In-Reply-To: <3bbf2fe11002281655i61a5f0a0if3f381ad0c4a1ef8@mail.gmail.com> References: <3bbf2fe11002281655i61a5f0a0if3f381ad0c4a1ef8@mail.gmail.com> Date: Tue, 2 Mar 2010 16:24:39 +0100 X-Google-Sender-Auth: 48c769c099cf82cf Message-ID: <3bbf2fe11003020724m14bebf74y9fa3906418b7cf11@mail.gmail.com> From: Attilio Rao To: freebsd-scsi@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: "Justin T. Gibbs" 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: Tue, 02 Mar 2010 15:24:48 -0000 2010/3/1 Attilio Rao : > Hello, > I have a question that I've been unable to reply reading the code. > Someone could point me to documentation explaining how the unit tailq > (within a struct periph_driver) is supposed to be locked? > I'm not sure how it is assured consistency of accesses to the list and > more important how is ensured that the periphs composing it doesn't go > away as I don't see any reference bump for objects inserted there. I don't think the lists are protected at all so I made this simple patch taking advantage by a global lock: http://www.freebsd.org/~attilio/Sandvine/pdrv/pdrv_lock.diff The patch is simple enough but I just test-compiled it (will need some time to run in a debugging kernel, hope to do tonight) and maybe you can already give your opinions here. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein