From owner-freebsd-fs@freebsd.org Tue Jan 26 19:22:03 2016 Return-Path: Delivered-To: freebsd-fs@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 1A61FA6EC6A for ; Tue, 26 Jan 2016 19:22:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (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 E725DE05 for ; Tue, 26 Jan 2016 19:22:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QJM2QA005046 for ; Tue, 26 Jan 2016 19:22:02 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-fs@FreeBSD.org Subject: [Bug 206652] [ext2fs][patch] EXT4: sparse file fixes and mmap optimizations Date: Tue, 26 Jan 2016 19:22:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: damjan.jov@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status keywords bug_severity priority component assigned_to reporter cc attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2016 19:22:03 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206652 Bug ID: 206652 Summary: [ext2fs][patch] EXT4: sparse file fixes and mmap optimizations Product: Base System Version: 11.0-CURRENT Hardware: Any OS: Any Status: New Keywords: patch Severity: Affects Some People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: damjan.jov@gmail.com CC: freebsd-fs@FreeBSD.org Created attachment 166156 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D166156&action= =3Dedit fix handling files with sparse blocks before extent's index, and implement = runb in mmap It turns out that the ei_blk on the first struct ext4_extent_index in an EX= T4 file's root extent isn't 0 if the file starts with sparse blocks. This will cause ext4_ext_binsearch_index() to keep passing the "if (lbn < m->ei_blk)" test, moving r to the left, until r < l, then set "path->ep_index =3D l - 1= ;" resulting in garbage data being read from wrong disk blocks since path->ep_index is pointing to before the first element of the array. I've attached a patch that keeps track of the first and last block in each extent as it descends down the extent tree, thus being able to work out that some blocks are sparse earlier, preventing the previous out of range proble= m. Tracking the first and last block in each extent also lets us calculate whe= re sparse extents end better, passing larger values to read ahead in mmap. In ext4_bmapext() I've also started supporting the runb parameter (which is apparently the number of adjacent blocks prior to the block being converted= in the same way that runp is the number of blocks after), which has sped up ra= ndom access to mmaped files. --=20 You are receiving this mail because: You are on the CC list for the bug.=