From owner-svn-src-all@FreeBSD.ORG Sun Sep 8 16:50:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 41466DFD; Sun, 8 Sep 2013 16:50:22 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vc0-x234.google.com (mail-vc0-x234.google.com [IPv6:2607:f8b0:400c:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D0B4F26A6; Sun, 8 Sep 2013 16:50:21 +0000 (UTC) Received: by mail-vc0-f180.google.com with SMTP id gf11so3418162vcb.11 for ; Sun, 08 Sep 2013 09:50:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=CYUCji8wT/YYIfsFw4VIOW+ZiUmmkbei5o+xPcwOSV8=; b=hXCgRTpmPC7+9yE5NcP7kXpDS2BIXk3Eur88Hfa+/XCSOThnnGBc4NuGR69Cc54sFE cpX4nric/rjgWdqGlrZzDGa/2mPJdFeW1ftmJYd6+mKV6IzTDPsBPR4TufPEOI+3cUjm BYJSpOx9zzKaV2gj74e34i8wOrslMgGZWqLmPjI16zncszkl9EeWJAz8k1xqld2Pv64V hj+N0qZGQC48Uk42JuvVeE63xlkYt2qXkguqV8bXxaUHkCNfntVQFM/xbjHltXhJSzc8 a0JFT+rgw+WWy0KqflVaj/d3zDAeaGvlPZmh+VZqG/e1wadwzOa0X4U3NgOC0es9v00Y X1vw== MIME-Version: 1.0 X-Received: by 10.52.75.165 with SMTP id d5mr11189633vdw.1.1378659020994; Sun, 08 Sep 2013 09:50:20 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.220.65.132 with HTTP; Sun, 8 Sep 2013 09:50:20 -0700 (PDT) In-Reply-To: References: <201309071345.r87Djj0P003439@svn.freebsd.org> Date: Sun, 8 Sep 2013 18:50:20 +0200 X-Google-Sender-Auth: rwWP9YwU7zLLLrYLMpIgtx77z5A Message-ID: Subject: Re: svn commit: r255359 - in head/sys: cddl/dev/dtrace dev/firewire dev/vkbd security/audit From: Davide Italiano To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2013 16:50:22 -0000 On Sun, Sep 8, 2013 at 6:24 PM, Ed Schouten wrote: > 2013/9/7 Davide Italiano : >> Log: >> - Use make_dev_credf(MAKEDEV_REF) instead of the race-prone make_dev()+ >> dev_ref() in the clone handlers that still use it. >> - Don't set SI_CHEAPCLONE flag, it's not used anywhere neither in devfs >> (for anything real) > > Wait. This piece of code is never used on FreeBSD HEAD, right? See > dtrace_load.c: > > #if __FreeBSD_version < 800039 > /* Enable device cloning. */ > clone_setup(&dtrace_clones); > > /* Setup device cloning events. */ > eh_tag = EVENTHANDLER_REGISTER(dev_clone, dtrace_clone, 0, > 1000); > #else > dtrace_dev = make_dev(&dtrace_cdevsw, 0, UID_ROOT, GID_WHEEL, > 0600, > "dtrace/dtrace"); > helper_dev = make_dev(&helper_cdevsw, 0, UID_ROOT, GID_WHEEL, > 0660, > "dtrace/helper"); > #endif > > -- > Ed Schouten Hi Ed, yes, you're right that's never used. I put that there only for consistency with the behaviour of other drivers. I think it's not good to leave examples of racy patterns, even if the code is not built anymore. If you have any kind of objections, I'll revert that. That said, let me clarify things a bit. Originally my goal was that of moving every clone handler to cdevpriv(9), but unfortunately 10 slush/freeze approached quicker than I expected, so I preferred to fix at least this racy behaviour before 10.0 release. I hope to start with this conversion when HEAD will be open for commit again, but that's not a priority. Thanks, -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare