From owner-freebsd-fs@freebsd.org Fri Oct 14 10:23:05 2016 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3BABC11126 for ; Fri, 14 Oct 2016 10:23:05 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 833CB813 for ; Fri, 14 Oct 2016 10:23:04 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from julian-mbp3.pixel8networks.com (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id u9EAN26T096040 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Fri, 14 Oct 2016 03:23:03 -0700 (PDT) (envelope-from julian@freebsd.org) To: "freebsd-fs@freebsd.org" From: Julian Elischer Subject: oddness in 10,3 .. mnt_ref leak? Message-ID: <58942da1-0b65-2b34-d91b-2fafcfa7d86b@freebsd.org> Date: Fri, 14 Oct 2016 03:22:57 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 10:23:05 -0000 I'm runnign 10.3 in our appliance and by chance I added code to print out the mnt-ref values of struct mount as htey are being changed.. to my surprise that reference count seems to be wildly wrong.. I added the following code to be run when it is decremented: #define MNT_REL(mp) do { \ if ((mp)->mnt_ref > 0) { \ (mp)->mnt_ref--; \ } else { \ printf("### %s (%s) negative mnt_ref, %d\n", __func__ ,mp->mnt_stat.f_mntonname, mp->mnt_ref); \ (mp->mnt_ref = 0); \ } \ if ((mp)->mnt_ref == 0) \ wakeup((mp)); \ } while (0) and I see this every few seconds: ### vfs_unbusy (/opt/pixel8/master_config) negative mnt_ref, 0 is there a chance that vfs_unbusy has no balancing MNT_REF when the file system becomes active again? I've looked through our patches (we do have some) but don't see a reason for this in them. Julian