gpfs: fix logic when gpfs:winattr is false (the default!)
authorRusty Russell <rusty@rustcorp.com.au>
Fri, 20 Nov 2009 09:39:57 +0000 (10:39 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 10 Mar 2010 12:22:17 +0000 (13:22 +0100)
On my autocluster setup, it's not set.  Maybe it should be?  Otherwise
smbclient and some Windows client programs will get errors like:

        # smbclient //localhost/data -Uadministrator%XXX
        Domain=[VSOFS1] OS=[Unix] Server=[Samba 3.4.2-ctdb-10]
        smb: \> put /etc/resolv.conf resolv.conf
        NT_STATUS_ACCESS_DENIED closing remote file \resolv.conf
        smb: \>

Caused by attempting to update the time on close.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Michael Adam <obnox@samba.org>
source3/modules/vfs_gpfs.c

index 4cbffcfc422d2196d696b6f47cf72eac328c9d9a..4c86aa6983b9c1a58dbe43fe06240963fb5341fb 100644 (file)
@@ -923,6 +923,11 @@ static int gpfs_set_xattr(struct vfs_handle_struct *handle,  const char *path,
         ret = set_gpfs_winattrs(CONST_DISCARD(char *, path),
                                GPFS_WINATTR_SET_ATTRS, &attrs);
         if ( ret == -1){
+               if (errno == ENOSYS) {
+                       return SMB_VFS_NEXT_SETXATTR(handle, path, name, value,
+                                                    size, flags);
+               }
+
                 DEBUG(1, ("gpfs_set_xattr:Set GPFS attributes failed %d\n",ret));
                 return -1;
         }
@@ -948,6 +953,11 @@ static size_t gpfs_get_xattr(struct vfs_handle_struct *handle,  const char *path
 
         ret = get_gpfs_winattrs(CONST_DISCARD(char *, path), &attrs);
         if ( ret == -1){
+               if (errno == ENOSYS) {
+                       return SMB_VFS_NEXT_GETXATTR(handle, path, name, value,
+                                                    size);
+               }
+
                 DEBUG(1, ("gpfs_get_xattr: Get GPFS attributes failed: %d\n",ret));
                 return -1;
         }
@@ -1065,7 +1075,7 @@ static int vfs_gpfs_ntimes(struct vfs_handle_struct *handle,
 
         ret = set_gpfs_winattrs(CONST_DISCARD(char *, path),
                                 GPFS_WINATTR_SET_CREATION_TIME, &attrs);
-        if(ret == -1){
+        if(ret == -1 && errno != ENOSYS){
                 DEBUG(1,("vfs_gpfs_ntimes: set GPFS ntimes failed %d\n",ret));
                 return -1;
         }