From owner-freebsd-stable@FreeBSD.ORG Tue May 10 04:14:49 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B14716A4EE for ; Tue, 10 May 2005 04:14:49 +0000 (GMT) Received: from natco3.natcotech.com (natco3.natcotech.com [205.167.142.103]) by mx1.FreeBSD.org (Postfix) with ESMTP id BFA7F43D5D for ; Tue, 10 May 2005 04:14:48 +0000 (GMT) (envelope-from smartweb@leadhill.net) Received: from ibm.nlcc.us (ldhl-ras1-dial-12-28-24-127.natcotech.com [12.28.24.127]) by natco3.natcotech.com (Postfix) with ESMTP id 4D71862AC0 for ; Mon, 9 May 2005 23:14:47 -0500 (CDT) Received: (qmail 31161 invoked by uid 89); 10 May 2005 04:14:46 -0000 Received: from unknown (HELO ?192.168.0.2?) (billy@192.168.0.2) by ibm.nlcc.us with SMTP; 10 May 2005 04:14:46 -0000 Message-ID: <4280353B.8050306@leadhill.net> Date: Mon, 09 May 2005 23:14:51 -0500 From: Billy Newsom User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-stable@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: nfs bug & df: Can I lock up my kernel and overflow this buffer? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2005 04:14:49 -0000 Here's something pretty stupid about either the code in mount, df, or both. I'm on the verge of a denial of service if this lasts much longer. When I mount an nfs device more than once, I get this ridiculous output from df and mount: #df Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/ad0s1a 253678 137554 95830 59% / devfs 1 1 0 100% /dev /dev/ad0s1e 253678 18 233366 0% /tmp /dev/ad0s1f 7782878 3273986 3886262 46% /usr /dev/ad0s1d 253678 125386 107998 54% /var devfs 1 1 0 100% /var/named/dev dell:/nfs 8883912 4104516 4779396 46% /dellbak dell:/nfs 8883912 4104516 4779396 46% /dellbak dell:/nfs 8883912 4104516 4779396 46% /dellbak dell:/nfs 8883912 4104516 4779396 46% /dellbak dell:/nfs 8883912 4104516 4779396 46% /dellbak dell:/nfs 8883912 4104516 4779396 46% /dellbak #mount /dev/ad0s1a on / (ufs, NFS exported, local) devfs on /dev (devfs, local) /dev/ad0s1e on /tmp (ufs, local, soft-updates) /dev/ad0s1f on /usr (ufs, NFS exported, local, soft-updates) /dev/ad0s1d on /var (ufs, NFS exported, local) devfs on /var/named/dev (devfs, local) dell:/nfs on /dellbak (nfs) dell:/nfs on /dellbak (nfs) dell:/nfs on /dellbak (nfs) dell:/nfs on /dellbak (nfs) dell:/nfs on /dellbak (nfs) dell:/nfs on /dellbak (nfs) Ha, ha! How many times will this last line repeat itself? I'm curious to see if I can get it to give me a screenful of data. Will this eventually crash the kernel or fill some buffer up? All I'm doing is mounting the same nfs drive over and over. Normally, mounting a device twice will just give a "device busy" or something. Is there some sanity check missing that will prevent mount_nfs from actually mounting the same resource at the same mount point over and over? Details: * FreeBSD 5.3. Updated and compiled in mid-February. I froze it there and may soon upgrade to 5.4, but I don't count on this fixing this issue. * I needed to make sure I had an nfs drive mounted properly, even after a reboot, but didn't want to (couldn't?) put it in fstab. So cron has this particular line(s). 44 10 * * * /sbin/mount_nfs -s -x 2 -T dell:/nfs /dellbak * I am connecting to a local net NFS server running Windows 2000 and Services for UNIX 3.5. Due to some major problems with rebooting and NFS, I determined that I needed some of the special commands (-s -x 2) to enable the server to reboot. * I put the mount_nfs command in cron and in an rc.d startup script because I didn't see a way to put all of the options in fstab, nor did I particularly enjoy booting the FreeBSD server without connecting to the NFS drive.... I would fill up my root directory pretty fast. * Look at the fsid for /dellbak below, using verbose output. Pretty odd. # mount -v /dev/ad0s1a on / (ufs, NFS exported, local, writes: sync 165 async 29170, reads: sync 2308 async 45, fsid f044aa41725bf386) devfs on /dev (devfs, local, fsid 01ff000404000000) /dev/ad0s1e on /tmp (ufs, local, soft-updates, writes: sync 9 async 4002, reads: sync 125 async 0, fsid f144aa411e8f31da) /dev/ad0s1f on /usr (ufs, NFS exported, local, soft-updates, writes: sync 420 async 129755, reads: sync 170752 async 1401, fsid f144aa4134661c3c) /dev/ad0s1d on /var (ufs, NFS exported, local, writes: sync 32187 async 49433, reads: sync 4043 async 102, fsid f244aa416aeef171) devfs on /var/named/dev (devfs, local, fsid 02ff000404000000) dell:/nfs on /dellbak (nfs, fsid 03ff000202000000) dell:/nfs on /dellbak (nfs, fsid 04ff000202000000) dell:/nfs on /dellbak (nfs, fsid 05ff000202000000) dell:/nfs on /dellbak (nfs, fsid 06ff000202000000) dell:/nfs on /dellbak (nfs, fsid 07ff000202000000) dell:/nfs on /dellbak (nfs, fsid 08ff000202000000) Any help? Thanks. BN