From owner-freebsd-bugs@FreeBSD.ORG Tue May 7 16:50:02 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E356C6E1 for ; Tue, 7 May 2013 16:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id BB7D8308 for ; Tue, 7 May 2013 16:50:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r47Go2Pg088702 for ; Tue, 7 May 2013 16:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r47Go2Kp088701; Tue, 7 May 2013 16:50:02 GMT (envelope-from gnats) Date: Tue, 7 May 2013 16:50:02 GMT Message-Id: <201305071650.r47Go2Kp088701@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Adam Nowacki Subject: Re: kern/178388: [zfs] [patch] allow up to 8MB recordsize X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Adam Nowacki List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 16:50:02 -0000 The following reply was made to PR kern/178388; it has been noted by GNATS. From: Adam Nowacki To: Matthew Rezny Cc: bug-followup@FreeBSD.org Subject: Re: kern/178388: [zfs] [patch] allow up to 8MB recordsize Date: Tue, 07 May 2013 18:46:05 +0200 On 2013-05-07 16:11, Matthew Rezny wrote: > The proposed patch is rather ugly. Is there some reason to not simply > change the definition of SPA_MAXBLOCKSIZE? Yes. Altering the value of SPA_MAXBLOCKSIZE will change the sizes of certain metadata objects that will break compatibility with non-patched systems. Just importing the pool on system with modified SPA_MAXBLOCKSIZE would result in this pool being inaccessible in non-patched systems - forever. It will also prevent booting from zfs pools as there is not enough memory available in the bootloader to support large block sizes for metadata or the loader files. > The point of defining a constant is it can then be changed in the place > it's defined rather than in every place it's used. Having to go change > every reference to it is error prone as missing a single reference could > wreck havoc. SPA_MAXBLOCKSIZE is used for far more than just a limit - in many places it is used as a default block size. I'm introducing SPA_BIGBLOCKSIZE because of the above compatibility problems and using it only in places that are essential to supporting large block sizes for file or zvol data leaving default block sizes unmodified (especially for pool metadata). The changed block size is only in effect when recordsize dataset property is modified by explicit action of the administrator. Existing and new datasets created post patch default to backwards compatible 128k block size. SPA_BIGBLOCKSIZE is used for asserts on the size of read/written block, ARC cache, recordsize property bounds checks and block size calculation logic. The names of the constants could probably be changed: current SPA_MAXBLOCKSIZE to SPA_DEFAULTBLOCKSIZE and the new SPA_BIGBLOCKSIZE to SPA_MAXBLOCKSIZE. > Specifically, I call into question the effect this has on the > definition of SPA_BLOCKSIZES. The reference to SPA_MAXBLOCKSIZE was not > replaced by SPA_BIGBLOCKSIZE and thus SPA_BLOCKSIZES is insufficiently > sized to represent all the possible block sizes that could be used. The SPA_BLOCKSIZES define is never used in the code and should probably be removed. > That one jumped out at me when I skimmed over the patch. I have not > reviewed all the ZFS code to look for other unchanged references that > are not part of the patch context. Keep in mind that I have been using this for two months now on 3 systems, 5 zpools and a total of over 50TB data written post-patch with varying record sizes (128k, 1MB, 4MB, 8MB). All systems boot directly from the big pools using unmodified (128k limited) bootloader.