I had originally implemented the In Kernel Sharetab with GFS and followed the requirement that everything had to be in a directory. As such, I made /system/dfs/sharetab and symlinked /etc/dfs/sharetab to it. Well, while I believe that is really the proper place for it to be at in the name space, I decided to hack GFS to allow me to have a single file as a filesystem - think /etc/mnttab. Between a lab shutdown yesterday and redoing the entire set of changes on kanigix and the latest OpenSolaris drop, I've got the thing working:
[tdh@kanigix dfs]> ls -la total 17 drwxr-xr-x 2 root sys 512 Feb 13 07:16 . drwxr-xr-x 88 root sys 4608 Feb 17 14:19 .. -rw-r--r-- 1 root sys 354 Feb 17 11:46 dfstab -rw-r--r-- 1 root root 68 Feb 17 12:07 fstypes -r--r--r-- 1 root root 246 Feb 17 14:22 sharetab [tdh@kanigix dfs]> cat sharetab /export/zfs/tdh - nfs rw /export/zfs/monster - nfs rw /export/zfs/nfsv4 - nfs rw /export/zfs/nfsv2 - nfs rw / - nfs rw /zoo/isos - nfs rw /export/zfs/nfsv3 - nfs rw /export/home - nfs sec=sys,rw=engineering home dirs /export/zfs - nfs rw
What I don't have working just right is the attribute changes:
[tdh@kanigix dfs]> sudo unshare -F nfs / [tdh@kanigix dfs]> ls -la total 17 drwxr-xr-x 2 root sys 512 Feb 13 07:16 . drwxr-xr-x 88 root sys 4608 Feb 17 14:19 .. -rw-r--r-- 1 root sys 354 Feb 17 11:46 dfstab -rw-r--r-- 1 root root 68 Feb 17 12:07 fstypes -r--r--r-- 1 root root 246 Feb 17 14:34 sharetab
The size and time will not change until I read the file:
[tdh@kanigix dfs]> cat sharetab /export/zfs/tdh - nfs rw /export/zfs/monster - nfs rw /export/zfs/nfsv4 - nfs rw /export/zfs/nfsv2 - nfs rw /zoo/isos - nfs rw /export/zfs/nfsv3 - nfs rw /export/home - nfs sec=sys,rw=engineering home dirs /export/zfs - nfs rw [tdh@kanigix dfs]> ls -la sharetab -r--r--r-- 1 root root 234 Feb 17 14:34 sharetab
I can easily fix that. Instead of recompiling the BFUs, I'm just going to rebuild 'sharefs'. Note if I could unload this module, I could do all of this without rebooting:
[tdh@kanigix sharefs]> pwd /home/tdh/ws/kanigix/usr/src/uts/common/fs/sharefs tdh@kanigix sharefs]> cd ../../../intel/sharefs [tdh@kanigix sharefs]> dmake dmake: defaulting to parallel mode. See the man page dmake(1) for more information on setting up the .dmakerc file. kanigix --> 1 job ...
To see what I need to get into /kernel, a 'dmake install' will tell me a lot:
[tdh@kanigix sharefs]> dmake install dmake: defaulting to parallel mode. See the man page dmake(1) for more information on setting up the .dmakerc file. /usr/bin/rm -f /home/tdh/ws/kanigix/proto/root_i386/kernel/fs/amd64/sharefs; install -s -m 755 -f /home/tdh/ws/kanigix/proto/root_i386/kernel/fs/amd64 debug64/sharefs /usr/bin/rm -f /home/tdh/ws/kanigix/proto/root_i386/kernel/fs/sharefs; install -s -m 755 -f /home/tdh/ws/kanigix/proto/root_i386/kernel/fs debug32/sharefs [tdh@kanigix sharefs]> sudo cp /home/tdh/ws/kanigix/proto/root_i386/kernel/fs/amd64/sharefs /kernel/fs/amd64/sharefs [tdh@kanigix sharefs]> sudo cp /home/tdh/ws/kanigix/proto/root_i386/kernel/fs/sharefs /kernel/fs/sharefs
Now I reboot and test!
The attributes are now following the changes:
[tdh@kanigix dfs]> ls -la sharetab -r--r--r-- 1 root root 182 Feb 17 14:43 sharetab [tdh@kanigix dfs]> sudo share -F nfs / [tdh@kanigix dfs]> ls -la sharetab -r--r--r-- 1 root root 194 Feb 17 14:46 sharetab
I'm pretty much done with the project. I have to pull out some code changes, tidy things up, do some more unit testing, and ship it off for some quality assurance. I'll check to see if I can get code put up to OpenSolaris.org in case people want to play with it.