11.30Snia$NetBSD: storage,v 1.30 2025/05/19 18:02:53 nia Exp $ 21.1Sagc 31.1SagcNetBSD Storage Roadmap 41.1Sagc====================== 51.1Sagc 61.1SagcThis is a small roadmap document, and deals with the storage and file 71.10Sdhollandsystems side of the operating system. It discusses elements, projects, 81.10Sdhollandand goals that are under development or under discussion; and it is 91.10Sdhollanddivided into three categories based on perceived priority. 101.10Sdholland 111.10SdhollandThe following elements, projects, and goals are considered strategic 121.10Sdhollandpriorities for the project: 131.10Sdholland 141.10Sdholland 1. Improving iscsi 151.10Sdholland 2. nfsv4 support 161.10Sdholland 3. A better journaling file system solution 171.30Snia 4. Stabilizing and improving zfs support 181.10Sdholland 5. Seamless full-disk encryption 191.11Sdholland 6. Finish tls-maxphys 201.10Sdholland 211.10SdhollandThe following elements, projects, and goals are not strategic 221.10Sdhollandpriorities but are still important undertakings worth doing: 231.10Sdholland 241.30Snia 7. lfs64 251.30Snia 8. Per-process namespaces 261.30Snia 9. lvm tidyup 271.30Snia 10. Flash translation layer 281.30Snia 11. Shingled disk support 291.30Snia 12. ext3/ext4 support 301.30Snia 13. Port hammer from Dragonfly 311.30Snia 14. afs maintenance 321.30Snia 15. execute-in-place 331.30Snia 16. extended attributes for acl and capability storage 341.10Sdholland 351.10SdhollandThe following elements, projects, and goals are perhaps less pressing; 361.10Sdhollandthis doesn't mean one shouldn't work on them but the expected payoff 371.10Sdhollandis perhaps less than for other things: 381.1Sagc 391.30Snia 17. coda maintenance 401.1Sagc 411.8Sagc 421.10SdhollandExplanations 431.10Sdholland============ 441.1Sagc 451.10Sdholland1. Improving iscsi 461.10Sdholland------------------ 471.1Sagc 481.10SdhollandBoth the existing iscsi target and initiator are fairly bad code, and 491.10Sdhollandneither works terribly well. Fixing this is fairly important as iscsi 501.10Sdhollandis where it's at for remote block devices. Note that there appears to 511.10Sdhollandbe no compelling reason to move the target to the kernel or otherwise 521.10Sdhollandmake major architectural changes. 531.10Sdholland 541.21Sdholland - As of January 2017 nobody is known to be working on this. 551.10Sdholland - There is currently no clear timeframe or release target. 561.10Sdholland - Contact agc for further information. 571.10Sdholland 581.10Sdholland 591.10Sdholland2. nfsv4 support 601.10Sdholland---------------- 611.10Sdholland 621.10Sdhollandnfsv4 is at this point the de facto standard for FS-level (as opposed 631.10Sdhollandto block-level) network volumes in production settings. The legacy nfs 641.10Sdhollandcode currently in NetBSD only supports nfsv2 and nfsv3. 651.10Sdholland 661.10SdhollandThe intended plan is to port FreeBSD's nfsv4 code, which also includes 671.10Sdhollandnfsv2 and nfsv3 support, and eventually transition to it completely, 681.10Sdhollanddropping our current nfs code. (Which is kind of a mess.) So far the 691.10Sdhollandonly step that has been taken is to import the code from FreeBSD. The 701.10Sdhollandnext step is to update that import (since it was done a while ago now) 711.10Sdhollandand then work on getting it to configure and compile. 721.10Sdholland 731.21Sdholland - As of January 2017 pgoyette has done a bit of prodding of the code 741.21Sdholland recently, but otherwise nobody is working on this, and a volunteer to 751.21Sdholland take charge and move it forward rapidly is urgently needed. 761.10Sdholland - There is no clear timeframe or release target, although having an 771.10Sdholland experimental version ready for -8 would be great. 781.10Sdholland - Contact dholland for further information. 791.10Sdholland 801.10Sdholland 811.10Sdholland3. A better journaling file system solution 821.10Sdholland------------------------------------------- 831.10Sdholland 841.10SdhollandWAPBL, the journaling FFS that NetBSD rolled out some time back, has a 851.10Sdhollandcritical problem: it does not address the historic ffs behavior of 861.10Sdhollandallowing stale on-disk data to leak into user files in crashes. And 871.10Sdhollandbecause it runs faster, this happens more often and with more data. 881.10SdhollandThis situation is both a correctness and a security liability. Fixing 891.10Sdhollandit has turned out to be difficult. It is not really clear what the 901.10Sdhollandbest option at this point is: 911.10Sdholland 921.10Sdholland+ Fixing WAPBL (e.g. to flush newly allocated/newly written blocks to 931.10Sdhollanddisk early) has been examined by several people who know the code base 941.13Sdhollandand judged difficult. Also, some other problems have come to light 951.20Sjdolecekmore recently; e.g. PR 50725, and 45676. Still, it might be the best 961.23Sjdolecekway forward. Some performance and stability issues were resolved 971.23Sjdolecekin netbsd-8, and more work is planned. 981.10Sdholland 991.10Sdholland+ There is another journaling FFS; the Harvard one done by Margo 1001.10SdhollandSeltzer's group some years back. We have a copy of this, but as it was 1011.10Sdhollandwritten in BSD/OS circa 1999 it needs a lot of merging, and then will 1021.10Sdhollandundoubtedly also need a certain amount of polishing to be ready for 1031.10Sdhollandproduction use. It does record-based rather than block-based 1041.10Sdhollandjournaling and does not share the stale data problem. 1051.10Sdholland 1061.10Sdholland+ We could bring back softupdates (in the softupdates-with-journaling 1071.10Sdhollandform found today in FreeBSD) -- this code is even more complicated 1081.10Sdhollandthan the softupdates code we removed back in 2009, and it's not clear 1091.10Sdhollandthat it's any more robust either. However, it would solve the stale 1101.10Sdhollanddata problem if someone wanted to port it over. It isn't clear that 1111.10Sdhollandthis would be any less work than getting the Harvard journaling FFS 1121.10Sdhollandrunning... or than writing a whole new file system either. 1131.10Sdholland 1141.10Sdholland+ We could write a whole new journaling file system. (That is, not 1151.10SdhollandFFS. Doing a new journaling FFS implementation is probably not 1161.10Sdhollandsensible relative to merging the Harvard journaling FFS.) This is a 1171.10Sdhollandbig project. 1181.10Sdholland 1191.10SdhollandRight now it is not clear which of these avenues is the best way 1201.10Sdhollandforward. Given the general manpower shortage, it may be that the best 1211.10Sdhollandway is whatever looks best to someone who wants to work on the 1221.10Sdhollandproblem. 1231.10Sdholland 1241.23Sjdolecek - There is no clear timeframe or release target; but given that WAPBL 1251.23Sjdolecek has been disabled by default for new installs in -7 this problem 1261.23Sjdolecek can reasonably be said to have become critical. 1271.23Sjdolecek - jdolecek fixed some WAPBL stability issues, that work is included 1281.23Sjdolecek in netbsd-8, could be possibly enough for making it default for new 1291.23Sjdolecek installs again; there is kern/47030 which seems to be triggered by WAPBL 1301.23Sjdolecek however 1311.16Sjdolecek - There has been some interest in the Harvard journaling FFS but no 1321.16Sjdolecek significant progress. Nobody is known to be working on or particularly 1331.10Sdholland interested in porting softupdates-with-journaling. And, while 1341.10Sdholland dholland has been mumbling for some time about a plan for a 1351.10Sdholland specific new file system to solve this problem, there isn't any 1361.10Sdholland realistic prospect of significant progress on that in the 1371.10Sdholland foreseeable future, and nobody else is known to have or be working 1381.10Sdholland on even that much. 1391.23Sjdolecek - Contact joerg, martin, or jdolecek regarding WAPBL; contact dholland 1401.23Sjdolecek regarding the Harvard journaling FFS. 1411.10Sdholland 1421.10Sdholland 1431.10Sdholland5. Seamless full-disk encryption 1441.10Sdholland-------------------------------- 1451.1Sagc 1461.10Sdholland(This is only sort of a storage issue.) We have cgd, and it is 1471.10Sdhollandbelieved to still be cryptographically suitable, at least for the time 1481.10Sdhollandbeing. However, we don't have any of the following things: 1491.1Sagc 1501.10Sdholland+ An easy way to install a machine with full-disk encryption. It 1511.10Sdhollandshould really just be a checkbox item in sysinst, or not much more 1521.10Sdhollandthan that. 1531.5Sagc 1541.10Sdholland+ Ideally, also an easy way to turn on full-disk encryption for a 1551.10Sdhollandmachine that's already been installed, though this is harder. 1561.1Sagc 1571.10Sdholland+ A good story for booting off a disk that is otherwise encrypted; 1581.10Sdhollandobviously one cannot encrypt the bootblocks, but it isn't clear where 1591.10Sdhollandin boot the encrypted volume should take over, or how to make a best 1601.10Sdhollandeffort at protecting the unencrypted elements needed to boot. (At 1611.10Sdhollandleast, in the absence of something like UEFI secure boot combined with 1621.29Srilliga cryptographic oracle to sign your bootloader image so UEFI will 1631.10Sdhollandaccept it.) There's also the question of how one runs cgdconfig(8) and 1641.10Sdhollandwhere the cgdconfig binary comes from. 1651.1Sagc 1661.10Sdholland+ A reasonable way to handle volume passphrases. MacOS apparently uses 1671.10Sdhollandlogin passwords for this (or as passphrases for secondary keys, or 1681.10Sdhollandsomething) and this seems to work well enough apart from the somewhat 1691.10Sdhollandsurreal experience of sometimes having to log in twice. However, it 1701.10Sdhollandwill complicate the bootup story. 1711.1Sagc 1721.10SdhollandGiven the increasing regulatory-level importance of full-disk 1731.10Sdhollandencryption, this is at least a de facto requirement for using NetBSD 1741.10Sdhollandon laptops in many circumstances. 1751.1Sagc 1761.21Sdholland - As of January 2017 nobody is known to be working on this. 1771.10Sdholland - There is no clear timeframe or release target. 1781.10Sdholland - Contact dholland for further information. 1791.5Sagc 1801.5Sagc 1811.11Sdholland6. Finish tls-maxphys 1821.11Sdholland--------------------- 1831.11Sdholland 1841.11SdhollandThe tls-maxphys branch changes MAXPHYS (the maximum size of a single 1851.11SdhollandI/O request) from a global fixed constant to a value that's probed 1861.11Sdhollandseparately for each particular I/O channel based on its 1871.11Sdhollandcapabilities. Large values are highly desirable for e.g. feeding large 1881.21Sdhollanddisk arrays and SSDs, but do not work with all hardware. 1891.11Sdholland 1901.11SdhollandThe code is nearly done and just needs more testing and support in 1911.11Sdhollandmore drivers. 1921.11Sdholland 1931.26Sjdolecek - On October 2017 jdolecek re-synced the branch, intention is to wrap 1941.25Sjdolecek this up for future netbsd-9 1951.25Sjdolecek - Contact jdolecek or tls for further information. 1961.11Sdholland 1971.11Sdholland 1981.30Snia7. lfs64 1991.10Sdholland-------- 2001.5Sagc 2011.10SdhollandLFS currently only supports volumes up to 2 TB. As LFS is of interest 2021.10Sdhollandfor use on shingled disks (which are larger than 2 TB) and also for 2031.10Sdhollanduse on disk arrays (ditto) this is something of a problem. A 64-bit 2041.10Sdhollandversion of LFS for large volumes is in the works. 2051.5Sagc 2061.21Sdholland - dholland was working on this in fall 2015 but time to finish it 2071.21Sdholland dried up. 2081.21Sdholland - The goal now is to get a few remaining things done in time for 8.0 2091.21Sdholland so it will at least be ready for experimental use there. 2101.10Sdholland - Responsible: dholland 2111.5Sagc 2121.8Sagc 2131.30Snia8. Per-process namespaces 2141.10Sdholland------------------------- 2151.5Sagc 2161.10SdhollandSupport for per-process variation of the file system namespace enables 2171.10Sdhollanda number of things; more flexible chroots, for example, and also 2181.10Sdhollandpotentially more efficient pkgsrc builds. dholland thought up a 2191.21Sdhollandsomewhat hackish but low-footprint way to implement this, and has a 2201.21Sdhollandpreliminary implementation, but concluded the scheme was too fragile 2211.21Sdhollandfor production. A different approach is probably needed, although the 2221.21Sdhollandexisting code could be tidied up and committed if that seems desirable. 2231.5Sagc 2241.21Sdholland - As of January 2017 nobody is working on this. 2251.21Sdholland - Contact: dholland 2261.5Sagc 2271.8Sagc 2281.30Snia9. lvm tidyup 2291.11Sdholland-------------- 2301.5Sagc 2311.10Sdholland[agc says someone should look at our lvm stuff; XXX fill this in] 2321.5Sagc 2331.21Sdholland - As of January 2017 nobody is known to be working on this. 2341.10Sdholland - There is no clear timeframe or release target. 2351.10Sdholland - Contact agc for further information. 2361.5Sagc 2371.1Sagc 2381.30Snia10. Flash translation layer 2391.11Sdholland--------------------------- 2401.9Sagc 2411.10SdhollandSSDs ship with firmware called a "flash translation layer" that 2421.10Sdhollandarbitrates between the block device software expects to see and the 2431.10Sdhollandraw flash chips. FTLs handle wear leveling, lifetime management, and 2441.10Sdhollandalso internal caching, striping, and other performance concerns. While 2451.10SdhollandNetBSD has a file system for raw flash (chfs), it seems that given 2461.10Sdhollandthings NetBSD is often used for it ought to come with a flash 2471.10Sdhollandtranslation layer as well. 2481.10Sdholland 2491.10SdhollandNote that this is an area where writing your own is probably a bad 2501.10Sdhollandplan; it is a complicated area with a lot of prior art that's also 2511.10Sdhollandreportedly full of patent mines. There are a couple of open FTL 2521.10Sdhollandimplementations that we might be able to import. 2531.10Sdholland 2541.21Sdholland - As of January 2017 nobody is known to be working on this. 2551.10Sdholland - There is no clear timeframe or release target. 2561.10Sdholland - Contact dholland for further information. 2571.10Sdholland 2581.10Sdholland 2591.30Snia11. Shingled disk support 2601.10Sdholland------------------------- 2611.10Sdholland 2621.10SdhollandShingled disks (or more technically, disks with "shingled magnetic 2631.10Sdhollandrecording" or SMR) can only write whole tracks at once. Thus, to 2641.10Sdhollandoperate effectively they require translation support similar to the 2651.10Sdhollandflash translation layers found in SSDs. The nature and structure of 2661.10Sdhollandshingle translation layers is still being researched; however, at some 2671.10Sdhollandpoint we will want to support these things in NetBSD. 2681.10Sdholland 2691.21Sdholland - As of 2016 one of dholland's coworkers was looking at this. 2701.10Sdholland - There is no clear timeframe or release target. 2711.10Sdholland - Contact dholland for further information. 2721.10Sdholland 2731.10Sdholland 2741.30Snia12. ext3/ext4 support 2751.10Sdholland--------------------- 2761.10Sdholland 2771.30SniaCurrently people are mostly using the kernel implementation of 2781.30Sniaext2 or using filesystems/fuse-ext2 from pkgsrc for later versions. 2791.30Snia 2801.10SdhollandWe would like to be able to read and write Linux ext3fs and ext4fs 2811.10Sdhollandvolumes. (We can already read clean ext3fs volumes as they're the same 2821.10Sdhollandas ext2fs, modulo volume features our ext2fs code does not support; 2831.10Sdhollandbut we can't write them.) 2841.10Sdholland 2851.10SdhollandIdeally someone would write ext3 and/or ext4 code, whether integrated 2861.10Sdhollandwith or separate from the ext2 code we already have. It might also 2871.10Sdhollandmake sense to port or wrap the Linux ext3 or ext4 code so it can be 2881.10Sdhollandloaded as a GPL'd kernel module; it isn't clear if that would be more 2891.10Sdhollandor less work than doing an implementation. 2901.10Sdholland 2911.10SdhollandNote however that implementing ext3 has already defeated several 2921.10Sdhollandpeople; this is a harder project than it looks. 2931.10Sdholland 2941.17Sjdolecek - GSoc 2016 brought support for extents, and also ro support for dir 2951.17Sjdolecek hashes; jdolecek also implemented several frequently used ext4 features 2961.17Sjdolecek so most contemporary ext filesystems should be possible to mount 2971.17Sjdolecek read-write 2981.28Sandvar - still need rw dir_nhash and xattr (semi-easy), and eventually journaling 2991.17Sjdolecek (hard) 3001.10Sdholland - There is no clear timeframe or release target. 3011.28Sandvar - jdolecek is working on improving ext3/ext4 support (particularly 3021.28Sandvar journaling) 3031.10Sdholland 3041.10Sdholland 3051.30Snia13. Port hammer from Dragonfly 3061.10Sdholland------------------------------ 3071.10Sdholland 3081.10SdhollandWhile the motivation for and role of hammer isn't perhaps super 3091.10Sdhollandpersuasive, it would still be good to have it. Porting it from 3101.10SdhollandDragonfly is probably not that painful (compared to, say, zfs) but as 3111.10Sdhollandthe Dragonfly and NetBSD VFS layers have diverged in different 3121.10Sdhollanddirections from the original 4.4BSD, may not be entirely trivial 3131.10Sdhollandeither. 3141.10Sdholland 3151.21Sdholland - As of January 2017 nobody is known to be working on this. 3161.10Sdholland - There is no clear timeframe or release target. 3171.10Sdholland - There probably isn't any particular person to contact; for VFS 3181.10Sdholland concerns contact dholland or hannken. 3191.10Sdholland 3201.10Sdholland 3211.30Snia14. afs maintenance 3221.10Sdholland------------------- 3231.10Sdholland 3241.10SdhollandAFS needs periodic care and feeding to continue working as NetBSD 3251.10Sdhollandchanges, because the kernel-level bits aren't kept in the NetBSD tree 3261.10Sdhollandand don't get updated with other things. This is an ongoing issue that 3271.10Sdhollandalways seems to need more manpower than it gets. It might make sense 3281.10Sdhollandto import some of the kernel AFS code, or maybe even just some of the 3291.10Sdhollandglue layer that it uses, in order to keep it more current. 3301.10Sdholland 3311.10Sdholland - jakllsch sometimes works on this. 3321.10Sdholland - We would like every release to have working AFS by the time it's 3331.10Sdholland released. 3341.10Sdholland - Contact jakllsch or gendalia about AFS; for VFS concerns contact 3351.10Sdholland dholland or hannken. 3361.10Sdholland 3371.10Sdholland 3381.30Snia15. execute-in-place 3391.10Sdholland-------------------- 3401.10Sdholland 3411.10SdhollandIt is likely that the future includes non-volatile storage (so-called 3421.10Sdholland"nvram") that looks like RAM from the perspective of software. Most 3431.10Sdhollandimportantly: the storage is memory-mapped rather than looking like a 3441.10Sdhollanddisk controller. There are a number of things NetBSD ought to have to 3451.10Sdhollandbe ready for this, of which probably the most important is 3461.10Sdholland"execute-in-place": when an executable is run from such storage, and 3471.10Sdhollandmapped into user memory with mmap, the storage hardware pages should 3481.10Sdhollandbe able to appear directly in user memory. Right now they get 3491.10Sdhollandgratuitously copied into RAM, which is slow and wasteful. There are 3501.10Sdhollandalso other reasons (e.g. embedded device ROMs) to want execute-in- 3511.10Sdhollandplace support. 3521.10Sdholland 3531.10SdhollandNote that at the implementation level this is a UVM issue rather than 3541.10Sdhollandstrictly a storage issue. 3551.10Sdholland 3561.10SdhollandAlso note that one does not need access to nvram hardware to work on 3571.10Sdhollandthis issue; given the performance profiles touted for nvram 3581.10Sdhollandtechnologies, a plain RAM disk like md(4) is sufficient both 3591.10Sdhollandstructurally and for performance analysis. 3601.10Sdholland 3611.21Sdholland - As of January 2017 nobody is known to be working on this. Some 3621.10Sdholland time back, uebayasi wrote some preliminary patches, but they were 3631.10Sdholland rejected by the UVM maintainers. 3641.10Sdholland - There is no clear timeframe or release target. 3651.10Sdholland - Contact dholland for further information. 3661.10Sdholland 3671.10Sdholland 3681.30Snia16. use extended attributes for ACL and capability storage 3691.15Schristos---------------------------------------------------------- 3701.15Schristos 3711.15SchristosCurrently there is some support for extended attributes in ffs, 3721.15Schristosbut nothing really uses it. I would be nice if we came up with 3731.15Schristosa standard format to store ACL's and capabilities like Linux has. 3741.15SchristosThe various tools must be modified to understand this and be able 3751.15Schristosto copy them if requested. Also tools to manipulate the data will 3761.15Schristosneed to be written. 3771.15Schristos 3781.21Sdholland 3791.30Snia17. coda maintenance 3801.10Sdholland-------------------- 3811.10Sdholland 3821.10SdhollandCoda only sort of works. [And I think it's behind relative to 3831.10Sdhollandupstream, or something of the sort; XXX fill this in.] Also the code 3841.10Sdhollandappears to have an ugly incestuous relationship with FFS. This should 3851.10Sdhollandreally be cleaned up. That or maybe it's time to remove Coda. 3861.10Sdholland 3871.21Sdholland - As of January 2017 nobody is known to be working on this. 3881.10Sdholland - There is no clear timeframe or release target. 3891.10Sdholland - There isn't anyone in particular to contact. 3901.15Schristos - Circa 2012 christos made it work read-write and split it 3911.15Schristos into modules. Since then christos has not tested it. 3921.9Sagc 3931.21Sdholland 3941.9SagcAlistair Crooks, David Holland 3951.10SdhollandFri Nov 20 02:17:53 EST 2015 3961.12SdhollandSun May 1 16:50:42 EDT 2016 (some updates) 3971.21SdhollandFri Jan 13 00:40:50 EST 2017 (some more updates) 3981.12Sdholland 399