Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Jun 2006 14:01:36 +0300
From:      Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
To:        freebsd-hackers@freebsd.org
Subject:   Question about synchronization (nfssvc, vfs_busy)
Message-ID:  <20060605110136.GA1348@pm513-1.comsys.ntu-kpi.kiev.ua>

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

Can somebody comment following questions?  I want to know where
I'm wrong (I checked CURRENT).

1.

If the nfsserver is a KLD, then it can be unloaded.  There is the
nfssvc(2) which is implemented in nfsserver and it is called without
Giant.  Suppose nfsrv_numnfsd is equal to 0 and some process calls
nfssvc(NFSSVC_ADDSOCK), as the result copyin() is called, which can
sleep due to possible vm fault, I do not even mention thread
preemption.

Now nfsserver is unloaded, since nfsrv_numnfsd is equal to zero;
when blocked process in copyin() wakes up, it will be continue
execution in non-existent KVM address space.

2.

If vfs_busy() is called without LK_NOWAIT flag, then it can sleep
if a filesystem is being unmounted.  At some point unmount() will
reach vfs_mount_destroy() and since there is one ref from vfs_busy()
it will sleep 3 seconds and will notice MNTK_MWAIT flag and wake up
a process, which is sleeping in vfs_busy().  How woken up process
can work with mount structure in vfs_busy() after wakeup(), which
could be already deallocated in vfs_mount_destroy()?



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