Indeed.

Actually this was exactly what we were trying to work out. We'd set the buf 
size to 0 hoping it would tell us how much we need, but we kept getting EINVAL 
back - which the docs states is invalid path, but actually it can be invalid 
bufsize as well apparently (the header file comments are different again to the 
docs).

Anyway, we're looking at patching mpifileutils to support GPFS ACLs to help 
with migration of between old and new file-systems.

I was actually using the opaque call on the assumption that it would be a 
binary blob of data I could poke to the new file. (I was too scared to use the 
attr functions as that copies DMAPI info as well and I'm not sure I want to 
"copy" my ILM files without recall!).

Its not clear what DEFAULT and ACCESS ACLs are. I'm guessing something to do 
with inheritance maybe?

Thanks Marc, Jonathan for the pointers!

Simon
________________________________________
From: [email protected] 
[[email protected]] on behalf of Jonathan Buzzard 
[[email protected]]
Sent: 17 December 2018 16:46
To: gpfsug main discussion list
Subject: Re: [gpfsug-discuss] GPFS API

On Mon, 2018-12-17 at 10:47 -0500, Marc A Kaplan wrote:
> Look in gps.h.... I think the comment for acl_buffer_len is clear
> enough!
>

I guess everyone does not read header files by default looking for
comments on the structure ;-)

One thing to watch out for is to check the return from gpfs_getacl, and
if you get an ENOSPC error then your buffer is not big enough to hold
the ACL and the first four bytes are set to the size you need. SO you
need to do something like the following to safely get the ACL.

        acl = malloc(1024);
        acl->acl_len = 1024;
        acl->acl_level = 0;
        acl->acl_version = 0;
        acl->acl_type = 0;
        acl->acl_nace = 0;

        err = gpfs_getacl(fpath, GPFS_GETACL_STRUCT, acl);
        if ((err==-1) && (errno=ENOSPC)) {
                int acl_size = acl->acl_len;
                free(acl);
                acl = malloc(acl_size);
                acl->acl_len = acl_size;
                acl->acl_level = 0;
                acl->acl_version = 0;
                acl->acl_type = 0;
                acl->acl_nace = 0;
                err = gpfs_getacl(fpath, GPFS_GETACL_STRUCT, acl);
        }

Noting that unless you have some monster ACL 1KB is going to be more
than enough. It is less than 16 bytes per ACL.

What is not clear is the following in the gpfs_acl struct.

v4Level1_t     v4Level1;  /* when GPFS_ACL_LEVEL_V4FLAGS */

What's that about, because there is zero documentation on it.

JAB.

--
Jonathan A. Buzzard                         Tel: +44141-5483420
HPC System Administrator, ARCHIE-WeSt.
University of Strathclyde, John Anderson Building, Glasgow. G4 0NG


_______________________________________________
gpfsug-discuss mailing list
gpfsug-discuss at spectrumscale.org
http://gpfsug.org/mailman/listinfo/gpfsug-discuss
_______________________________________________
gpfsug-discuss mailing list
gpfsug-discuss at spectrumscale.org
http://gpfsug.org/mailman/listinfo/gpfsug-discuss

Reply via email to