OpenSolaris Gets In-Kernel CIFS Server

Exporting a ZFS filesystem via NFS is easy, you just use the command

zfs set sharesmb=on POOLNAME/FSNAME

In order to share via CIFS (sometimes called SMB) to windows clients, you used to have to use Samba. This is not a problem for simple setups that dont use Active Directory, but can be a pain if you do as the ACL model in Windows is completely different to Unix (One of the few areas Windows is better in my opinion). Samba get around this by adding hooking up to OpenLDAP, adding a VFS layer (pdf) and reimplementing Kerboros/LDAP to match the Microsoft version, all of which are far from trivial to set up. I love Samba and think it is one of the best pieces of free software there is.

Sun have just released a CIFS implementation in the SunOS kernel, based on a stack that they got when they bought Procom. As well as serving up files via CIFS, they have modified the ACL system to be a sort of hybrid or old style Posix and Windows style ones. I think they have been planning this for a while as NFSv4 ACLs are similar to NTFS ones but still map on to Posix style eventually. So the end result is you will be able to write

zfs set sharecifs=on POOLNAME/FSNAME

and have the filesystem exported. The fact that it is in-kernel and integrated with ZFS is cool, but this on-disk storing of the ACL information is the best feature. Check out Mike Shapiro and Alan Wright’s blogs on the topic, the full spec and the project page for more details.

That is not to say Samba is useless, I was very excited by the examples here, particularly the patch to implement shadow copies using ZFS, but maybe people will move away from it in favour of a more tightly integrated in-kernel implementation. The CIFS client in Linux is now in-kernel (still written by the Samba guys though) as it is in SunOS and Darwin (Sun ported the Darwin version). Untill NFSv4, Samba was definitely the best way to share files between Unixes, due to some nifty Posix Extensions and the throughput from the efficient implementation (beating in-kernel NFS from Linux in my testing, it may still be the best way). Samba beats Windows servers for throughput and number of clients served, the SMBTorture suite they developed even got mentioned (search for Evil Empire) by a Microsoft guy as they now use it to test their implementation.

When I get it on my NAS, I’ll post benchmarks.