• Paulo Alcantara's avatar
    cifs: improve symlink handling for smb2+ · 76894f3e
    Paulo Alcantara authored
    When creating inode for symlink, the client used to send below
    requests to fill it in:
    
        * create+query_info+close (STATUS_STOPPED_ON_SYMLINK)
        * create(+reparse_flag)+query_info+close (set file attrs)
        * create+ioctl(get_reparse)+close (query reparse tag)
    
    and then for every access to the symlink dentry, the ->link() method
    would send another:
    
        * create+ioctl(get_reparse)+close (parse symlink)
    
    So, in order to improve:
    
        (i) Get rid of unnecessary roundtrips and then resolve symlinks as
    	follows:
    
            * create+query_info+close (STATUS_STOPPED_ON_SYMLINK +
    	                           parse symlink + get reparse tag)
            * create(+reparse_flag)+query_info+close (set file attrs)
    
        (ii) Set the resolved symlink target directly in inode->i_link and
             use simple_get_link() for ->link() to simply return it.
    Signed-off-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
    Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
    Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
    76894f3e
smb2ops.c 159 KB