gpfs 3.5 and Samba Compatibility

Nimrod Sapir NIMRODS at il.ibm.com
Mon May 28 02:53:55 MDT 2012


Hello


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.

Thanks
Nimrod Sapir
IBM - XIV, Israel
NAS Development Team
Office: +972-3-689-7763
Cell:   +972-54-7726-320
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 1338 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20120528/c8f369c5/attachment.gif>


More information about the samba-technical mailing list