From owner-freebsd-bugs@FreeBSD.ORG Wed Aug 11 11:40:24 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 264F116A4CE for ; Wed, 11 Aug 2004 11:40:24 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0773343D67 for ; Wed, 11 Aug 2004 11:40:24 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i7BBeNoU088459 for ; Wed, 11 Aug 2004 11:40:23 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i7BBeNXR088458; Wed, 11 Aug 2004 11:40:23 GMT (envelope-from gnats) Resent-Date: Wed, 11 Aug 2004 11:40:23 GMT Resent-Message-Id: <200408111140.i7BBeNXR088458@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jan Srzednicki Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 90F8016A4CF for ; Wed, 11 Aug 2004 11:37:38 +0000 (GMT) Received: from zikkurat.wrzask.pl (zikkurat.wrzask.pl [213.134.171.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 49F2543D31 for ; Wed, 11 Aug 2004 11:37:38 +0000 (GMT) (envelope-from root@zikkurat.wrzask.pl) Received: by zikkurat.wrzask.pl (Postfix, from userid 0) id 0E199E6; Wed, 11 Aug 2004 13:37:34 +0200 (CEST) Message-Id: <20040811113734.0E199E6@zikkurat.wrzask.pl> Date: Wed, 11 Aug 2004 13:37:34 +0200 (CEST) From: Jan Srzednicki To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/70297: request to make amd timeouts per-mount local X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Aug 2004 11:40:24 -0000 >Number: 70297 >Category: bin >Synopsis: request to make amd timeouts per-mount local >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Aug 11 11:40:23 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Jan Srzednicki >Release: FreeBSD 5.2-CURRENT i386 >Organization: oak.pl >Environment: System: FreeBSD zikkurat.wrzask.pl 5.2-CURRENT FreeBSD 5.2-CURRENT #4: Wed Aug 4 18:17:00 CEST 2004 root@zikkurat.wrzask.pl:/usr/obj/usr/src/sys/SIN i386 >Description: Amd is a daemon that automatically mounts file systems on access ocasions. It's built into a NFS architecture, but it's use is not limited to it and it can be used for automounting CD drives, floppies, wakeing up sleeping (spinned down) and rarely-accessed drives. It makes much sense to treat all these cases in a different way, all of them should have different cache duration timeouts and umount intervals. In case of a CD, they have to be really small to react to CD eject and to release the CD really fast after the system stopped using it. On the other hand, spinning the disk down makes sense after an hour or so, as the spin-up and spin-down process takes some time (and is not that healthy to the drive itself). Quite another thing is with NFS mounts, and still, making a distinction between local network ones and really remote ones makes sense to me. Of course, I don't want to change any commandline options. Setting -c or -w should still set global defaults, but these can be overridden in amd.conf(5), in the per-mount sections (cache_duration and dismount_interval config options, accordingly). >How-To-Repeat: >Fix: I've briefly looked into the amd code and it's data structures. As I understand it, it shouldn't be hard to make the change. The am_node structure already has local am_timeo and am_timeo_w. Local am_timeo gets initialized from global options in the init_map() function (in /usr/src/contrib/amd/amd/map.c). The cf_map_t structure (from /usr/src/contrib/amd/amd/amd.h) needs to be updated to include both options. I'm not that familiar with the code to find out where the local variables from amd.conf are really used (while creating the node), so I haven't fixed the thing by myself, but I guess it won't be a big effort for someone familiar with it. >Release-Note: >Audit-Trail: >Unformatted: