From owner-cvs-all@FreeBSD.ORG Tue Apr 29 12:46:43 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9227E37B401; Tue, 29 Apr 2003 12:46:43 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 453B143F93; Tue, 29 Apr 2003 12:46:43 -0700 (PDT) (envelope-from phk@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3TJkh0U003046; Tue, 29 Apr 2003 12:46:43 -0700 (PDT) (envelope-from phk@repoman.freebsd.org) Received: (from phk@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3TJkgA2003040; Tue, 29 Apr 2003 12:46:42 -0700 (PDT) Message-Id: <200304291946.h3TJkgA2003040@repoman.freebsd.org> From: Poul-Henning Kamp Date: Tue, 29 Apr 2003 12:46:42 -0700 (PDT) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/geom/bde g_bde_crypt.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2003 19:46:44 -0000 phk 2003/04/29 12:46:42 PDT FreeBSD src repository Modified files: sys/geom/bde g_bde_crypt.c Log: Fix an obscure fencepost error in GBDE's sector mapping code: For certain combinations of sectorsize, mediasize and random numbers (used to define the mapping), a multisector read or write would ignore some subset of the sectors past the first sector in the request because those sectors would be mapped past the end of the parent device, and normal "end of media" truncation would zap that part of the request. Rev 1.19+1.20 of g_bde_work.c added the check which should have alerted me to this happening. This commit maps the request correctly and adds KASSERTS to make sure things stay inside the parent device. This does not change the on-disk layout of GBDE, there is no need to backup/restore. Revision Changes Path 1.14 +26 -0 src/sys/geom/bde/g_bde_crypt.c