From owner-freebsd-net@FreeBSD.ORG Thu Aug 30 00:23:45 2012 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05CF11065670 for ; Thu, 30 Aug 2012 00:23:45 +0000 (UTC) (envelope-from vijju.singh@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8B5038FC14 for ; Thu, 30 Aug 2012 00:23:44 +0000 (UTC) Received: by eaak11 with SMTP id k11so379788eaa.13 for ; Wed, 29 Aug 2012 17:23:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=Lq0LIsc0SrP5RJ5+1YIeKVqSBSgsHVfQKTvCTbcWttA=; b=MJaIIepn4SZIBNOCf0VOlL1NmVsFasFlNgMivxvYPHGsGjx6NCCRh+gbSNa1j4+ecP d5IRRPnuZMKFeghdyFp0KMA/9p2JNnnvd2VC1Uym8e7Ahur27aiT3w1IyVYIL+VujNMh FQKPD7ihoXBudbJ4fRuWvmU2fbiV7OZUBh/E92KwVC6J/gUBUNd0Bb4How6fUcVTX12G p8OSJA3RgTK2gjHryGoGI07ypKMIOhoYP9SZ9foTRc352Q+zi1RU+QU9I3IE+Eo0pNj3 w0jTr4Diwl0Bev/WM1A785EsMbf401Ia7DflsHPz5468ym9Gb5n1fOC02brTzj/M/+kD 5vXA== MIME-Version: 1.0 Received: by 10.14.205.6 with SMTP id i6mr930396eeo.13.1346286223202; Wed, 29 Aug 2012 17:23:43 -0700 (PDT) Received: by 10.14.219.134 with HTTP; Wed, 29 Aug 2012 17:23:43 -0700 (PDT) Date: Wed, 29 Aug 2012 17:23:43 -0700 Message-ID: From: Vijay Singh To: net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: sorele() and ACCEPT_LOCK() X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2012 00:23:45 -0000 Is there any reason why sorele() needs the accept lock to be held? 231 #define sorele(so) do { \ 232 ACCEPT_LOCK_ASSERT(); \ 233 SOCK_LOCK_ASSERT(so); \ 234 if ((so)->so_count <= 0) \ 235 panic("sorele"); \ 236 if (--(so)->so_count == 0) \ 237 sofree(so); \ 238 else { \ 239 SOCK_UNLOCK(so); \ 240 ACCEPT_UNLOCK(); \ 241 } \ 242 } while (0) -vijay