From owner-freebsd-stable@FreeBSD.ORG Mon Feb 7 09:01:20 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F091F106564A for ; Mon, 7 Feb 2011 09:01:20 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [IPv6:2607:f678:1010::34]) by mx1.freebsd.org (Postfix) with ESMTP id CE34E8FC14 for ; Mon, 7 Feb 2011 09:01:20 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id p1791KYT017519 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 7 Feb 2011 01:01:20 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id p1791JKQ017518 for freebsd-stable@freebsd.org; Mon, 7 Feb 2011 01:01:19 -0800 (PST) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA05699; Mon, 7 Feb 11 00:54:42 PST Date: Mon, 07 Feb 2011 00:53:14 -0800 From: perryh@pluto.rain.com To: freebsd-stable@freebsd.org Message-Id: <4d4fb2fa.1SlxGA2eA/1ZnThg%perryh@pluto.rain.com> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_4d4fb2fa.2fyW/KoxitQVnB0sLEBgqhJojRSolpeB2cP7k/ChHeHL/5/p" Subject: minor data-typing error in 8.1 fs/devfs/devfs_vnops.c X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2011 09:01:21 -0000 This is a multi-part message in MIME format. --=_4d4fb2fa.2fyW/KoxitQVnB0sLEBgqhJojRSolpeB2cP7k/ChHeHL/5/p Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline Noticed while digging through devfs_read_f() and devfs_write_f() in the course of investigating some unexpected (by me) geom behavior: ... int ioflag, error, resid; ... resid = uio->uio_resid; ... if (uio->uio_resid != resid || ... IOW resid (an int) is being assigned from and compared with uio->uio_resid (an ssize_t). I suppose it's probably harmless on any arch where an (int) is at least as large as an (ssize_t), but strictly speaking it does look like a bug -- or am I missing something? --=_4d4fb2fa.2fyW/KoxitQVnB0sLEBgqhJojRSolpeB2cP7k/ChHeHL/5/p Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="devfs_vnops.c-resid-patch" --- fs/devfs/devfs_vnops.c-81R Sun Jun 13 19:09:06 2010 +++ - Sun Feb 6 23:58:34 2011 @@ -1046,7 +1046,8 @@ devfs_read_f(struct file *fp, struct uio *uio, struct ucred *cred, int flags, struct thread *td) { struct cdev *dev; - int ioflag, error, resid; + int ioflag, error; + ssize_t resid; struct cdevsw *dsw; struct file *fpop; @@ -1489,7 +1490,8 @@ devfs_write_f(struct file *fp, struct uio *uio, struct ucred *cred, int flags, struct thread *td) { struct cdev *dev; - int error, ioflag, resid; + int error, ioflag; + ssize_t resid; struct cdevsw *dsw; struct file *fpop; --=_4d4fb2fa.2fyW/KoxitQVnB0sLEBgqhJojRSolpeB2cP7k/ChHeHL/5/p--