• Steve French's avatar
    smb3: add support for stat of WSL reparse points for special file types · 2e4564b3
    Steve French authored
    This is needed so when mounting to Windows we do not
    misinterpret various special files created by Linux (WSL) as symlinks.
    An earlier patch addressed readdir.  This patch fixes stat (getattr).
    
    With this patch:
      File: /mnt1/char
      Size: 0          Blocks: 0          IO Block: 16384  character special file
    Device: 34h/52d Inode: 844424930132069  Links: 1     Device type: 0,0
    Access: (0755/crwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
    Access: 2020-10-21 17:46:51.839458900 -0500
    Modify: 2020-10-21 17:46:51.839458900 -0500
    Change: 2020-10-21 18:30:39.797358800 -0500
     Birth: -
      File: /mnt1/fifo
      Size: 0          Blocks: 0          IO Block: 16384  fifo
    Device: 34h/52d Inode: 1125899906842722  Links: 1
    Access: (0755/prwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
    Access: 2020-10-21 16:21:37.259249700 -0500
    Modify: 2020-10-21 16:21:37.259249700 -0500
    Change: 2020-10-21 18:30:39.797358800 -0500
     Birth: -
      File: /mnt1/block
      Size: 0          Blocks: 0          IO Block: 16384  block special file
    Device: 34h/52d Inode: 844424930132068  Links: 1     Device type: 0,0
    Access: (0755/brwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
    Access: 2020-10-21 17:10:47.913103200 -0500
    Modify: 2020-10-21 17:10:47.913103200 -0500
    Change: 2020-10-21 18:30:39.796725500 -0500
     Birth: -
    
    without the patch all show up incorrectly as symlinks with annoying "operation not supported error also returned"
      File: /mnt1/charstat: cannot read symbolic link '/mnt1/char': Operation not supported
    
      Size: 0          Blocks: 0          IO Block: 16384  symbolic link
    Device: 34h/52d Inode: 844424930132069  Links: 1
    Access: (0000/l---------)  Uid: (    0/    root)   Gid: (    0/    root)
    Access: 2020-10-21 17:46:51.839458900 -0500
    Modify: 2020-10-21 17:46:51.839458900 -0500
    Change: 2020-10-21 18:30:39.797358800 -0500
     Birth: -
      File: /mnt1/fifostat: cannot read symbolic link '/mnt1/fifo': Operation not supported
    
      Size: 0          Blocks: 0          IO Block: 16384  symbolic link
    Device: 34h/52d Inode: 1125899906842722  Links: 1
    Access: (0000/l---------)  Uid: (    0/    root)   Gid: (    0/    root)
    Access: 2020-10-21 16:21:37.259249700 -0500
    Modify: 2020-10-21 16:21:37.259249700 -0500
    Change: 2020-10-21 18:30:39.797358800 -0500
     Birth: -
      File: /mnt1/blockstat: cannot read symbolic link '/mnt1/block': Operation not supported
    
      Size: 0          Blocks: 0          IO Block: 16384  symbolic link
    Device: 34h/52d Inode: 844424930132068  Links: 1
    Access: (0000/l---------)  Uid: (    0/    root)   Gid: (    0/    root)
    Access: 2020-10-21 17:10:47.913103200 -0500
    Modify: 2020-10-21 17:10:47.913103200 -0500
    Change: 2020-10-21 18:30:39.796725500 -0500
    Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
    Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
    2e4564b3
inode.c 75.9 KB