From owner-svn-src-head@FreeBSD.ORG Fri Feb 20 20:49:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6BF0167; Fri, 20 Feb 2015 20:49:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 899397EC; Fri, 20 Feb 2015 20:49:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1KKn1XB080450; Fri, 20 Feb 2015 20:49:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1KKn1Ni080449; Fri, 20 Feb 2015 20:49:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201502202049.t1KKn1Ni080449@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 20 Feb 2015 20:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279089 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2015 20:49:01 -0000 Author: markj Date: Fri Feb 20 20:49:00 2015 New Revision: 279089 URL: https://svnweb.freebsd.org/changeset/base/279089 Log: Don't specify a resid parameter if we're just going to ignore it. Instead, let vn_rdwr() check for short reads. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/kern_ctf.c Modified: head/sys/kern/kern_ctf.c ============================================================================== --- head/sys/kern/kern_ctf.c Fri Feb 20 20:33:43 2015 (r279088) +++ head/sys/kern/kern_ctf.c Fri Feb 20 20:49:00 2015 (r279089) @@ -68,7 +68,6 @@ link_elf_ctf_get(linker_file_t lf, linke int flags; int i; int nbytes; - ssize_t resid; size_t sz; struct nameidata nd; struct thread *td = curthread; @@ -125,7 +124,7 @@ link_elf_ctf_get(linker_file_t lf, linke /* Read the ELF header. */ if ((error = vn_rdwr(UIO_READ, nd.ni_vp, hdr, sizeof(*hdr), - 0, UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED, &resid, + 0, UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED, NULL, td)) != 0) goto out; @@ -148,7 +147,7 @@ link_elf_ctf_get(linker_file_t lf, linke /* Read all the section headers */ if ((error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t)shdr, nbytes, hdr->e_shoff, UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED, - &resid, td)) != 0) + NULL, td)) != 0) goto out; /* @@ -170,8 +169,7 @@ link_elf_ctf_get(linker_file_t lf, linke /* Read the section header strings. */ if ((error = vn_rdwr(UIO_READ, nd.ni_vp, shstrtab, shdr[hdr->e_shstrndx].sh_size, shdr[hdr->e_shstrndx].sh_offset, - UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED, &resid, - td)) != 0) + UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED, NULL, td)) != 0) goto out; /* Search for the section containing the CTF data. */ @@ -190,7 +188,7 @@ link_elf_ctf_get(linker_file_t lf, linke /* Read the CTF header. */ if ((error = vn_rdwr(UIO_READ, nd.ni_vp, ctf_hdr, sizeof(ctf_hdr), shdr[i].sh_offset, UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, - NOCRED, &resid, td)) != 0) + NOCRED, NULL, td)) != 0) goto out; /* Check the CTF magic number. (XXX check for big endian!) */ @@ -249,7 +247,7 @@ link_elf_ctf_get(linker_file_t lf, linke */ if ((error = vn_rdwr(UIO_READ, nd.ni_vp, raw == NULL ? ctftab : raw, shdr[i].sh_size, shdr[i].sh_offset, UIO_SYSSPACE, IO_NODELOCKED, - td->td_ucred, NOCRED, &resid, td)) != 0) + td->td_ucred, NOCRED, NULL, td)) != 0) goto out; /* Check if decompression is required. */