gpfs 3.5 and Samba Compatibility

Christof Schmitt christof.schmitt at us.ibm.com
Thu May 31 15:55:13 MDT 2012


samba-technical-bounces at lists.samba.org wrote on 05/28/2012 01:53:55 AM:

> We are currently using GPFS 3.5 and Samba 3.6.4 for our NAS solution, 
and 
> I've encounter a compatibility issue between the two. I'm not sure if 
you 
> already discovered this issue and plan to fix it (in 3.6.x or 4.0). 
Still, 
> here is the description of what I've found and the code changes needed 
to 
> fix it.
> 
> In vfs_gpfs.c file, two methods are using sizeof(struct gpfs_acl) taken 
> from gpfs.h. The two are gpfsacl_process_smbacl and smb2gpfs_acl. 
However, 
> this size has changed in gpfs 3.5, due to the change in the size of the 
> internal union. In smb2gpfs_acl this union is redefined as 
gpfs_ace_union. 
> The result of this issue is that when using the above combination, the 
> calculation of the ACL length is wrong, and changing the ACL through 
Samba 
> (in my case, trying to change permissions on the security tab in the 
file 
> properties in Windows) returns "invalid_parameter" error from gpfs. So, 
> two changes are required.
> 
> Change the gpfs_ace_union inside smb2gpfs_acl to match the one in 
gpfs.h. 
> Instead of:
> 
> 
>         union gpfs_ace_union
>         {
>                 gpfs_ace_v1_t  ace_v1[1]; /* when GPFS_ACL_VERSION_POSIX 

> */
>                 gpfs_ace_v4_t  ace_v4[1]; /* when GPFS_ACL_VERSION_NFS4 
*/
>         };
> It needs to be:
>         union gpfs_ace_union
>         {
>                 gpfs_ace_v1_t  ace_v1[1]; /* when GPFS_ACL_VERSION_POSIX 

> */
>                 gpfs_ace_v4_t  ace_v4[1]; /* when GPFS_ACL_VERSION_NFS4 
*/
>                  v4Level1_t     v4Level1;  /* when 
GPFS_ACL_LEVEL_V4FLAGS 
> */
>         };
> 
> Change the logic inside  gpfsacl_process_smbacl  to take the new size 
into 
> account. Instead of the old logic, I've duplicated the logic from 
> gpfs_ace_union and got:
> 
>         union gpfs_ace_union
>         {
>                 gpfs_ace_v1_t  ace_v1[1]; /* when GPFS_ACL_VERSION_POSIX 

> */
>                 gpfs_ace_v4_t  ace_v4[1]; /* when GPFS_ACL_VERSION_NFS4 
*/
>         v4Level1_t     v4Level1;  /* when GPFS_ACL_LEVEL_V4FLAGS */
>         };
> 
>         gacl_len = sizeof(struct gpfs_acl) - sizeof(union 
gpfs_ace_union) 
> +
>                 smb_get_naces(smbacl)*sizeof(gpfs_ace_v4_t);
> 
> Of course, there is no need to duplicate the definition of 
gpfs_ace_union, 
> so a better solution would be to define the union outside the scope of 
> those two methods. An even better solution would be to name this union 
> whithin gpfs.h itself, and use this name inside the gpfs_acl. I can try 
> and ask the gpfs people who helped with analyzing this issue about about 

> such a fix, if you believe it is helpful. 
> 
> I haven't done a full testing of this fix yet, but it seems to resolve 
the 
> issue.
> 
> Let me know what you think.

>From a brief look, making this change would tie Samba to GPFS
3.5. A proper solution should allow a binary of the vfs_gpfs
module to work with GPFS 3.5 and older versions.

I am not sure if this can be done automatically, there is always
the fallback of adding a config option to specify the format.
When reading an ACL, simply allocating enough space and then
deciding according to the gpfs_acl header could be
enough. Writing might be more complicated as the Samba module
would not know beforehand which format to try.

Regards,

Christof Schmitt || IBM || SONAS System Development || Tucson, AZ
christof.schmitt at us.ibm.com  ||  +1-520-799-2469  (T/L: 321-2469)



More information about the samba-technical mailing list