kern/114057: devfs symlink over device doesn't work

Stef Walter stef at
Tue Jun 26 22:30:04 UTC 2007

>Number:         114057
>Category:       kern
>Synopsis:       devfs symlink over device doesn't work
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 26 22:30:03 GMT 2007
>Originator:     Stef Walter
>Release:        FreeBSD 6.2
FreeBSD 6.2-RELEASE-p1 FreeBSD 6.2-RELEASE-p1 #2: Tue Jun 26 15:55:31 UTC 2007     root at  i386

After deleting a device in devfs, any symlink placed over it results in

I'll attach a patch that fixes this.

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


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);
-	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));


More information about the freebsd-bugs mailing list