Posix ACL on ZFS

73 views
Skip to first unread message

Massimo Maggi

unread,
Jan 23, 2011, 6:55:47 PM1/23/11
to kqstor-zf...@googlegroups.com
Hi everyone,
Since the open of issue 101
(https://github.com/zfs-linux/zfs/issues/#issue/101) regarding ACLs on
ZFS, nobody replied.
I've started looking at zfs source code, and I've tried to implement
Posix ACL compatibility myself, by inspecting ext3 source code (lzfs
module is GPL, and not CDDL, right??).
My implementation is working, and passes the PJD POSIX file system test
suite ( http://www.tuxera.com/community/posix-test-suite/ ) except for
one point: tests/xacl/00.t test number 45. (modifying an acl shouldn't
change ctime). But also ext3 fails this test.
I've packaged my tree, the kernel I've used (compiled to be used in KVM,
also with virtio) and the config file used to generate it at
http://public.maxstorage.axu.it/zfs-with-acl.tbz2 , if someone wants to
check it out.
I've removed all of .ko and .o files for licensing issues (for my very
poor understanding of law, it's not legal to distribute binary
derivatives of GPL+CDDL code, so binary kernel modules and object files.
Am I right?).
The source code is *very* messy,I know, and I expect it won't compile
against any other kernel version than 2.6.36.
It has *A LOT* of printk's and a call to spl_debug_mydumpstack which
pollutes your dmesg.
All of my changes are inside lzfs module. I've tried to keep the biggest
part of the code in a new file (lzfs_xattr_acl.c) but there are some
small changes elsewhere.
If there is an interest in this code for upstream merging, I will clean
it, split it in git commits (with useful descriptions) and make it
availabile for example on my github account. Otherwise I won't bother to
do it. (maybe it is not welcome for compatibility reasons with other
platforms or whatever).
Obviously it comes without any guarantee.
Massimo Maggi

Anand Mitra

unread,
Jan 23, 2011, 8:29:32 PM1/23/11
to kqstor-zf...@googlegroups.com
Hi Massimo,

We would love to have a look at your take at ACLs !
I can create a branch from the master and push your changes upstream. Once your changes look good we can merge them back into the master.

If you fork from our repository and make your changes on that I'll be glad to pull your changes on to the branch. Or drop be a patch which ever you prefer.

regards
-- 
Anand Mitra

Massimo Maggi

unread,
Jan 25, 2011, 10:44:15 AM1/25/11
to kqstor-zf...@googlegroups.com
Ok, I've posted it at https://github.com/maxximino/lzfs .
Actually it builds and passes PJD POSIX file system test (except test
about ctime change on acl change, see first mail) in those kernel versions:

* 2.6.35.8
* 2.6.34.7
* 2.6.33.7
* 2.6.32.28

As it doesn't include my own patch for 2.6.36, it won't work on >=2.6.36
as-is, but ACL and xattr specific interfaces are the same, so with your
patch it should work.
Tests were conducted with SPL and ZFS in /master in your tree as of today.
Keep me updated!
Regards
Massimo Maggi

Massimo Maggi

unread,
Feb 1, 2011, 7:42:07 PM2/1/11
to kqstor-zf...@googlegroups.com
Hi,
I've happily seen that my changes were improved and merged upstream!
But refactoring introduced a little regression with the PJD test suite.
Here you can find a simple correcting commit, based on your today's master:
https://github.com/maxximino/lzfs/commit/a2c7ab064c1277d73b3fffe650177299764e4d1c
In my very few spare moments I'm trying hard to make your code crash!
Even with stress (http://weather.ou.edu/~apw/projects/stress/) eating up
all the memory and swap used at 50%, it doesn't crash.
Wonderful.
Massimo Maggi

Anand Mitra

unread,
Feb 1, 2011, 9:08:33 PM2/1/11
to kqstor-zf...@googlegroups.com, kqstor-...@googlegroups.com
Hi Massimo,

Thanks for your contribution, we will fix the regression. 
We will be attributing your contribution in the change logs. Unfortunately the commit to the master bringing in these changes does not attribute the patch to you, I apologize for that oversight.

regards
-- 
mitra

fpmurphy

unread,
Feb 2, 2011, 4:07:24 PM2/2/11
to KQStor ZFS Discussion
Humm, adding POSIX ACLs is NOT fixing a regression. They were never
in ZFS in the first place. ZFS on Solaris uses NFSv4-style ACLs. See
http://dlc.sun.com/osol/docs/content/ZFSADMIN/gbacb.html


On Feb 1, 9:08 pm, Anand Mitra <mi...@kqinfotech.com> wrote:
> Hi Massimo,
>
> Thanks for your contribution, we will fix the regression.
> We will be attributing your contribution in the change logs. Unfortunately
> the commit to the master bringing in these changes does not attribute the
> patch to you, I apologize for that oversight.
>
> regards
> --
> mitra
>
>
>
>
>
>
>
> On Wed, Feb 2, 2011 at 6:12 AM, Massimo Maggi <mass...@mmmm.it> wrote:
> > Hi,
> > I've happily seen that my changes were improved and merged upstream!
> > But refactoring introduced a little regression with the PJD test suite.
> > Here you can find a simple correcting commit, based on your today's master:
>
> >https://github.com/maxximino/lzfs/commit/a2c7ab064c1277d73b3fffe65017...
> > >> On Mon, Jan 24, 2011 at 5:25 AM, Massimo Maggi <mass...@mmmm.it
> > >> <mailto:mass...@mmmm.it>> wrote:
>
> > >>     Hi everyone,
> > >>     Since the open of issue 101
> > >>     (https://github.com/zfs-linux/zfs/issues/#issue/101) regarding ACLs
> > on
> > >>     ZFS, nobody replied.
> > >>     I've started looking at zfs source code, and I've tried to implement
> > >>     Posix ACL compatibility myself, by inspecting ext3 source code (lzfs
> > >>     module is GPL, and not CDDL, right??).
> > >>     My implementation is working, and passes the PJD POSIX file system
> > >>     test
> > >>     suite (http://www.tuxera.com/community/posix-test-suite/) except
> > for
> > >>     one point: tests/xacl/00.t test number 45. (modifying an acl
> > shouldn't
> > >>     change ctime). But also ext3 fails this test.
> > >>     I've packaged my tree, the kernel I've used (compiled to be used
> > >>     in KVM,
> > >>     also with virtio) and the config file used to generate it at
> > >>    http://public.maxstorage.axu.it/zfs-with-acl.tbz2, if someone

Massimo Maggi

unread,
Feb 2, 2011, 4:48:08 PM2/2/11
to kqstor-zf...@googlegroups.com
It's a small regression referred to my original patches for ACL!
Developers at KQ Infotech have cleaned them up and "extracted" a
function common to many points in the code.
Original patches passed all except one (see first mail below or in
archives) tests of PJD test suite, while new code failed 19 tests.
This can be fixed with the 12-line commit linked in my mail.
I'm almost sure that Anand Mitra correctly understood what I've intended
by word "regression".
I know that Solaris uses NFSv4-style ACLs, but in the linux world they
aren't widely.
Instead Linux kernel offers interfaces to *easily* implement POSIX ACL
support, and in ZFS this can be done without breaking on-disk format.
Solaris simply sees one or two more extended attributes only when POSIX
ACLs are effectively used. Why waste this opportunity to better
integrate the two worlds?? (Linux and ZFS)
Have a nice day!
Massimo Maggi
Reply all
Reply to author
Forward
0 new messages