From owner-svn-src-all@freebsd.org Wed May 11 10:51:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D30E5B3761E; Wed, 11 May 2016 10:51:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74DED129D; Wed, 11 May 2016 10:51:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4BAoxR5021128; Wed, 11 May 2016 10:50:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4BAoxm0021127; Wed, 11 May 2016 10:50:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605111050.u4BAoxm0021127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 11 May 2016 10:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299428 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2016 10:51:00 -0000 Author: hselasky Date: Wed May 11 10:50:59 2016 New Revision: 299428 URL: https://svnweb.freebsd.org/changeset/base/299428 Log: Return a proper error code instead of panicing when an I/O vector having the wrong number of entries is detected. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 11 10:40:04 2016 (r299427) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Wed May 11 10:50:59 2016 (r299428) @@ -487,9 +487,9 @@ linux_dev_read(struct cdev *dev, struct if ((error = devfs_get_cdevpriv((void **)&filp)) != 0) return (error); filp->f_flags = file->f_flag; + /* XXX no support for I/O vectors currently */ if (uio->uio_iovcnt != 1) - panic("linux_dev_read: uio %p iovcnt %d", - uio, uio->uio_iovcnt); + return (EOPNOTSUPP); if (filp->f_op->read) { bytes = filp->f_op->read(filp, uio->uio_iov->iov_base, uio->uio_iov->iov_len, &uio->uio_offset); @@ -522,9 +522,9 @@ linux_dev_write(struct cdev *dev, struct if ((error = devfs_get_cdevpriv((void **)&filp)) != 0) return (error); filp->f_flags = file->f_flag; + /* XXX no support for I/O vectors currently */ if (uio->uio_iovcnt != 1) - panic("linux_dev_write: uio %p iovcnt %d", - uio, uio->uio_iovcnt); + return (EOPNOTSUPP); if (filp->f_op->write) { bytes = filp->f_op->write(filp, uio->uio_iov->iov_base, uio->uio_iov->iov_len, &uio->uio_offset); @@ -638,9 +638,9 @@ linux_file_read(struct file *file, struc error = 0; filp = (struct linux_file *)file->f_data; filp->f_flags = file->f_flag; + /* XXX no support for I/O vectors currently */ if (uio->uio_iovcnt != 1) - panic("linux_file_read: uio %p iovcnt %d", - uio, uio->uio_iovcnt); + return (EOPNOTSUPP); if (filp->f_op->read) { bytes = filp->f_op->read(filp, uio->uio_iov->iov_base, uio->uio_iov->iov_len, &uio->uio_offset);