Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jun 2007 22:22:07 GMT
From:      Stef Walter <stef@memberwebs.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/114057: devfs symlink over device doesn't work
Message-ID:  <200706262222.l5QMM7V8081917@www.freebsd.org>
Resent-Message-ID: <200706262230.l5QMU3xa079635@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         114057
>Category:       kern
>Synopsis:       devfs symlink over device doesn't work
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 26 22:30:03 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Stef Walter
>Release:        FreeBSD 6.2
>Organization:
>Environment:
FreeBSD jail-devel-6x.ws.local 6.2-RELEASE-p1 FreeBSD 6.2-RELEASE-p1 #2: Tue Jun 26 15:55:31 UTC 2007     root@jail-devel-6x.ws.local:/usr/src/sys/i386/compile/JAIL-DEVEL  i386

>Description:
After deleting a device in devfs, any symlink placed over it results in
ENOENT.

I'll attach a patch that fixes this.

>How-To-Repeat:
  # cd /dev
  # rm console
  # touch /var/log/console
  # ln -s /var/log/console console
  # ls -l console
  ls: console: No such file or directory

>Fix:


Patch attached with submission follows:

--- sys/fs/devfs/devfs_vnops.c.orig	Mon Oct 30 15:46:29 2006
+++ sys/fs/devfs/devfs_vnops.c	Tue Jun 26 16:16:24 2007
@@ -1263,7 +1263,7 @@
 #ifdef MAC
 	mac_create_devfs_symlink(ap->a_cnp->cn_cred, dmp->dm_mount, dd, de);
 #endif
-	TAILQ_INSERT_TAIL(&dd->de_dlist, de, de_list);
+	TAILQ_INSERT_HEAD(&dd->de_dlist, de, de_list);
 	return (devfs_allocv(de, ap->a_dvp->v_mount, ap->a_vpp, td));
 }
 


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706262222.l5QMM7V8081917>