vfs_gpfs: Adjust debug level when get_winattrs returns EBADF
authorChristof Schmitt <cs@samba.org>
Wed, 23 May 2018 22:04:08 +0000 (15:04 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 25 May 2018 20:52:12 +0000 (22:52 +0200)
This is returned for a get_winattrs call against a non-gpfs file system.
This can happen for the .. entry when listing a share on the file system
root.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_gpfs.c

index a0fd48fab7cb3206e6be2a2b3f7e7f3c72df33d8..965dfac92a0feb2fec1442d54a18cd80a83a1049 100644 (file)
@@ -1612,7 +1612,16 @@ static NTSTATUS vfs_gpfs_get_dos_attributes(struct vfs_handle_struct *handle,
        if (ret == -1 && errno == EACCES) {
                ret = get_dos_attr_with_capability(smb_fname, &attrs);
        }
-       if (ret == -1) {
+
+       if (ret == -1 && errno == EBADF) {
+               /*
+                * Returned for directory listings in gpfs root for
+                * .. entry which steps out of gpfs.
+                */
+               DBG_DEBUG("Getting winattrs for %s returned EBADF.\n",
+                         smb_fname->base_name);
+               return map_nt_error_from_unix(errno);
+       } else if (ret == -1) {
                DBG_WARNING("Getting winattrs failed for %s: %s\n",
                            smb_fname->base_name, strerror(errno));
                return map_nt_error_from_unix(errno);