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

Stef Walter stef at memberwebs.com
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
>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 at 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:


More information about the freebsd-bugs mailing list