• Paulo Alcantara's avatar
    cifs: reduce roundtrips on create/qinfo requests · c877ce47
    Paulo Alcantara authored
    To work around some Window servers that return
    STATUS_OBJECT_NAME_INVALID on query infos under DFS namespaces that
    contain non-ASCII characters, we started checking for -ENOENT on every
    file open, and if so, then send additional requests to figure out
    whether it is a DFS link or not.  It means that all those requests
    will be sent to every non-existing file.
    
    So, in order to reduce the number of roundtrips, check earlier whether
    status code is STATUS_OBJECT_NAME_INVALID and tcon supports dfs, and
    if so, then map -ENOENT to -EREMOTE so mount or automount will take
    care of chasing the DFS link -- if it isn't an DFS link, then -ENOENT
    will be returned appropriately.
    
    Before patch
    
      SMB2 438 Create Request File: ada.test\dfs\foo;GetInfo Request...
      SMB2 310 Create Response, Error: STATUS_OBJECT_NAME_NOT_FOUND;...
      SMB2 228 Ioctl Request FSCTL_DFS_GET_REFERRALS, File: \ada.test\dfs\foo
      SMB2 143 Ioctl Response, Error: STATUS_OBJECT_PATH_NOT_FOUND
      SMB2 438 Create Request File: ada.test\dfs\foo;GetInfo Request...
      SMB2 310 Create Response, Error: STATUS_OBJECT_NAME_NOT_FOUND;...
      SMB2 228 Ioctl Request FSCTL_DFS_GET_REFERRALS, File: \ada.test\dfs\foo
      SMB2 143 Ioctl Response, Error: STATUS_OBJECT_PATH_NOT_FOUND
    
    After patch
    
      SMB2 438 Create Request File: ada.test\dfs\foo;GetInfo Request...
      SMB2 310 Create Response, Error: STATUS_OBJECT_NAME_NOT_FOUND;...
      SMB2 438 Create Request File: ada.test\dfs\foo;GetInfo Request...
      SMB2 310 Create Response, Error: STATUS_OBJECT_NAME_NOT_FOUND;...
    Signed-off-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
    Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
    c877ce47
inode.c 81.9 KB