diff options
author | jh <jh@FreeBSD.org> | 2010-06-01 18:57:21 +0000 |
---|---|---|
committer | jh <jh@FreeBSD.org> | 2010-06-01 18:57:21 +0000 |
commit | 73a91f4cc74bf4ec4a6029ea69b15b8782506d1d (patch) | |
tree | b295eddd682bc9be24be7bf501623d19fe20d99c /sys/fs | |
parent | 74a35cff029a00a2ae1f33698259bad0ea1c9a61 (diff) | |
download | FreeBSD-src-73a91f4cc74bf4ec4a6029ea69b15b8782506d1d.zip FreeBSD-src-73a91f4cc74bf4ec4a6029ea69b15b8782506d1d.tar.gz |
Don't try to call cdevsw d_close() method when devfs_close() is called
because of insmntque1() failure.
Found with: stress2
Suggested and reviewed by: kib
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/devfs/devfs_vnops.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 4c059cd..88937a6 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -459,6 +459,13 @@ devfs_close(struct vop_close_args *ap) int vp_locked, error; /* + * XXX: Don't call d_close() if we were called because of + * XXX: insmntque1() failure. + */ + if (vp->v_data == NULL) + return (0); + + /* * Hack: a tty device that is a controlling terminal * has a reference from the session structure. * We cannot easily tell that a character device is |