From owner-freebsd-bugs@freebsd.org Thu Aug 25 12:34:22 2016 Return-Path: Delivered-To: freebsd-bugs@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 8E236BC510F for ; Thu, 25 Aug 2016 12:34:22 +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 7321B1CDF for ; Thu, 25 Aug 2016 12:34:22 +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 u7PCYMPD080157 for ; Thu, 25 Aug 2016 12:34:22 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 212139] r298900 introduced a fatal failure case for >2TB disk size reporting bugs Date: Thu, 25 Aug 2016 12:34:22 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-RC1 X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: peter@FreeBSD.org 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 bug_severity priority component assigned_to reporter 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-bugs@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 12:34:22 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212139 Bug ID: 212139 Summary: r298900 introduced a fatal failure case for >2TB disk size reporting bugs Product: Base System Version: 11.0-RC1 Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: peter@FreeBSD.org Created attachment 174052 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D174052&action= =3Dedit Hack workaround We have machines in the freebsd.org cluster that have 3TB SATA drives. ada0: 2861588MB (5860533168 512 byte sectors) However, the bios reports them as: disk0: BIOS drive C (1565565872 X 512): ie: the 3TB drive is reported to the loader as 1TB. Prior to r298900, this was harmless. IO was issued relative to the metadat= a on the disk. r298900 changed it from working to a fatal error: + if (dblk >=3D BD(dev).bd_sectors) { + DEBUG("IO past disk end %llu", (unsigned long long)dblk); + return (EIO); + } and it won't even try. This makes machines that used to work (in spite of a bios reporting bug) suddenly fail with an IO error. While this was observed with ZFS booting, it will affect UFS the same way as they share this code i= f it tries to read data beyond the truncated size. I have attached a horrible hack that works for the affected machines in the freebsd.org package build cluster. It is not an ideal solution but people = may find it useful. The patch is a hack to restrict attempted reads beyond the end of the disk = to one single sector rather than a hard fail. This should make it behave the = same way as old versions of the bcache code. If the bios generates an error, it would do so the same as it did with the old code. Using a single sector prevents read-ahead amplifying delays. A better solution might be to have the file system / partition drivers inst= ead tell bcache what size to expect so that it can avoid doing read-aheads beyo= nd the end of a partition. If a 3TB GPT is on a disk, that should be used for= IO and readahead clipping, not the historically unreliable bios sector count. Differences could be reported to the user. This problem is in 11.0-RC1, 11-stable and 12-current. --=20 You are receiving this mail because: You are the assignee for the bug.=