Date: Mon, 5 Jun 2006 20:30:45 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua> Cc: freebsd-hackers@freebsd.org Subject: Re: Question about synchronization (nfssvc, vfs_busy) Message-ID: <20060605173045.GA45380@deviant.kiev.zoral.com.ua> In-Reply-To: <20060605110136.GA1348@pm513-1.comsys.ntu-kpi.kiev.ua> References: <20060605110136.GA1348@pm513-1.comsys.ntu-kpi.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
--sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 05, 2006 at 02:01:36PM +0300, Andrey Simonenko wrote: > 2. >=20 > If vfs_busy() is called without LK_NOWAIT flag, then it can sleep > if a filesystem is being unmounted. At some point unmount() will If vfs_busy() is called without LK_NOWAIT and fs is being unmounted, then vfs_busy returns with ENOENT error, isn't it ? > 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()? vfs_busy() internally increases the ref count for mount point, so, it cannot be taken from under it (look for MNT_REF/MNT_REL). Simultameous entrance into the code in question in vfs_busy/vfs_mount_destroy is protected by mnt_mtx (MNT_ILOCK/MNT_IUNLOCK). --sm4nu43k4a2Rpi4c Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFEhGpEC3+MBN1Mb4gRAhKLAKCzcwZcg0H7mlo5gt/FoSya8+HZMgCdGRBM QS+AKE9KhokSOoPDSb7Cxo8= =GDxq -----END PGP SIGNATURE----- --sm4nu43k4a2Rpi4c--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060605173045.GA45380>