Subject: Re[2]: Handling of device special files in BSD vnode/vfs
To:, der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Vasanth Kanchan <>
List: tech-kern
Date: 03/03/1997 16:09:23
        I am looking through checkalias() if the files are on the UFS 
     filesystem for example then vp->v_tag== VT_UFS and checkalias() will 
     mark vnode as VALIASED and return NULLVP. The 2 vnodes will be aliased 
     but distinct. Causing cache coherency problems. In the case of vnode 
     created by bedvvp() vp->v_tag == VT_NON the aliased vnode is returned. 
     This will be handled correctly. Am I still missing something?

______________________________ Reply Separator _________________________________
Subject: Re: Handling of device special files in BSD vnode/vfs
Author:  der Mouse  <mouse@Rodents.Montreal.QC.CA> at Internet_Mail_Link
Date:    3/3/97 6:00 PM

> The vnode/vfs code prevents opening of device special files if it is 
> mounted or prevents mounting of the file if it has been opened.
> However consider the case where 2 different file names either on the 
> same filesystem or different filesystem map to the same device.  If 
> these files are opened, the read/write will be cached through their 
> repective vnode's with unpredictable results.  Is this correct ?
> What does checkaliases() do?
Fix this very problem. :-)  In kern/vfs_subr.c, the comment says
 * Check to see if the new vnode represents a special device 
 * for which we already have a vnode (either because of
 * bdevvp() or because of a different vnode representing
 * the same block device). If such an alias exists, deallocate 
 * the existing contents and return the aliased vnode. The
 * caller is responsible for filling it with its new contents. 
(by the way, it's checkalias, not checkaliases, at least in 1.2.)  The 
comment is slightly inaccurate in that it appears to work for character 
devices as well as block devices.
					der Mouse

		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B