Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jul 2011 21:07:41 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sys/fs/devfs devfs_vnops.c
Message-ID:  <201107132107.p6DL7vgZ047850@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
kib         2011-07-13 21:07:41 UTC

  FreeBSD src repository

  Modified files:
    sys/fs/devfs         devfs_vnops.c 
  Log:
  SVN rev 223988 on 2011-07-13 21:07:41Z by kib
  
  While fixing the looping of a thread while devfs vnode is reclaimed,
  r179247 introduced a possibility of devfs_allocv() returning spurious
  ENOENT. If the vnode is selected by vnlru daemon for reclamation, then
  devfs_allocv() can get ENOENT from vget() due to devfs_close() dropping
  vnode lock around the call to cdevsw d_close method.
  
  Use LK_RETRY in the vget() call, and do some part of the devfs_reclaim()
  work in devfs_allocv(), clearing vp->v_data and de->de_vnode. Retry the
  allocation of the vnode, now with de->de_vnode == NULL.
  
  The check vp->v_data == NULL at the start of devfs_close() cannot be
  affected by the change, since vnode lock must be held while VI_DOOMED
  is set, and only dropped after the check.
  
  Reported and tested by: Kohji Okuno <okuno.kohji jp panasonic com>
  Reviewed by:    attilio
  MFC after:      3 weeks
  
  Revision  Changes    Path
  1.199     +12 -6     src/sys/fs/devfs/devfs_vnops.c



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