Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Jan 2016 20:29:28 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r293059 - head/sys/fs/devfs
Message-ID:  <201601022029.u02KTSbS099642@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sat Jan  2 20:29:28 2016
New Revision: 293059
URL: https://svnweb.freebsd.org/changeset/base/293059

Log:
  Hide transient EBADF errors caused by the parallel revoke(2) or forced
  unmount of devfs mounts, by restarting the failed syscall.
  
  When restarted, failing syscalls eventually either stop finding the
  node and returning ENOENT, or the vnode op vectors finally transition
  to the deadfs vop.  The later return EIO or other error, more
  appropriate for the operation.
  
  Submitted by:	bde
  Tested by:	pho
  MFC after:	3 weeks

Modified:
  head/sys/fs/devfs/devfs_vnops.c

Modified: head/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- head/sys/fs/devfs/devfs_vnops.c	Sat Jan  2 19:34:37 2016	(r293058)
+++ head/sys/fs/devfs/devfs_vnops.c	Sat Jan  2 20:29:28 2016	(r293059)
@@ -244,18 +244,18 @@ devfs_populate_vp(struct vnode *vp)
 	if (DEVFS_DMP_DROP(dmp)) {
 		sx_xunlock(&dmp->dm_lock);
 		devfs_unmount_final(dmp);
-		return (EBADF);
+		return (ERESTART);
 	}
 	if ((vp->v_iflag & VI_DOOMED) != 0) {
 		sx_xunlock(&dmp->dm_lock);
-		return (EBADF);
+		return (ERESTART);
 	}
 	de = vp->v_data;
 	KASSERT(de != NULL,
 	    ("devfs_populate_vp: vp->v_data == NULL but vnode not doomed"));
 	if ((de->de_flags & DE_DOOMED) != 0) {
 		sx_xunlock(&dmp->dm_lock);
-		return (EBADF);
+		return (ERESTART);
 	}
 
 	return (0);



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