From owner-svn-src-stable-9@FreeBSD.ORG Fri Jun 14 02:51:04 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 237DC812; Fri, 14 Jun 2013 02:51:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 147401996; Fri, 14 Jun 2013 02:51:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5E2p3nt024917; Fri, 14 Jun 2013 02:51:03 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5E2p3eF024916; Fri, 14 Jun 2013 02:51:03 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201306140251.r5E2p3eF024916@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 14 Jun 2013 02:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251726 - stable/9/lib/libstand X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jun 2013 02:51:04 -0000 Author: pfg Date: Fri Jun 14 02:51:03 2013 New Revision: 251726 URL: http://svnweb.freebsd.org/changeset/base/251726 Log: MFC r251561: libstand: Reset the seek pointer in ext2fs as done in UFS. Reset the seek pointer to 0 when a file is successfully opened, since otherwise the initial seek offset will contain the directory offset of the filesystem block that contained its directory entry. This bug was mostly harmless because typically the directory is less than one filesystem block in size so the offset would be zero. It did however generally break loading a kernel from the (large) kernel compile directory. Also reset the seek pointer when a new inode is opened in read_inode(), though this is not actually necessary now because all callers set it afterwards. PR: 177328 Submitted by: Eric van Gyzen Reviewed by: iedowse Modified: stable/9/lib/libstand/ext2fs.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libstand/ (props changed) Modified: stable/9/lib/libstand/ext2fs.c ============================================================================== --- stable/9/lib/libstand/ext2fs.c Fri Jun 14 02:25:40 2013 (r251725) +++ stable/9/lib/libstand/ext2fs.c Fri Jun 14 02:51:03 2013 (r251726) @@ -536,6 +536,7 @@ ext2fs_open(const char *upath, struct op * Found terminal component. */ error = 0; + fp->f_seekp = 0; out: if (buf) free(buf); @@ -584,6 +585,7 @@ read_inode(ino_t inumber, struct open_fi for (level = 0; level < NIADDR; level++) fp->f_blkno[level] = -1; fp->f_buf_blkno = -1; + fp->f_seekp = 0; out: free(buf);