diff options
author | Paulo Alcantara <pc@manguebit.com> | 2024-02-02 19:42:11 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2024-03-11 03:33:58 +0300 |
commit | 8bd25b61c5a55bc769c6608e9ce95860759acdcb (patch) | |
tree | 157d0cff469b2e63f95a42a57b59868e38ccc755 /fs/smb/client/reparse.c | |
parent | 78e26bec4d6d3aef04276e28bed48a45fd00e116 (diff) | |
download | linux-8bd25b61c5a55bc769c6608e9ce95860759acdcb.tar.xz |
smb: client: set correct d_type for reparse DFS/DFSR and mount point
Set correct dirent->d_type for IO_REPARSE_TAG_DFS{,R} and
IO_REPARSE_TAG_MOUNT_POINT reparse points.
Signed-off-by: Paulo Alcantara <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client/reparse.c')
-rw-r--r-- | fs/smb/client/reparse.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/smb/client/reparse.c b/fs/smb/client/reparse.c index 29a47f20643b..a0ffbda90733 100644 --- a/fs/smb/client/reparse.c +++ b/fs/smb/client/reparse.c @@ -482,34 +482,35 @@ bool cifs_reparse_point_to_fattr(struct cifs_sb_info *cifs_sb, switch (le64_to_cpu(buf->InodeType)) { case NFS_SPECFILE_CHR: fattr->cf_mode |= S_IFCHR; - fattr->cf_dtype = DT_CHR; fattr->cf_rdev = reparse_nfs_mkdev(buf); break; case NFS_SPECFILE_BLK: fattr->cf_mode |= S_IFBLK; - fattr->cf_dtype = DT_BLK; fattr->cf_rdev = reparse_nfs_mkdev(buf); break; case NFS_SPECFILE_FIFO: fattr->cf_mode |= S_IFIFO; - fattr->cf_dtype = DT_FIFO; break; case NFS_SPECFILE_SOCK: fattr->cf_mode |= S_IFSOCK; - fattr->cf_dtype = DT_SOCK; break; case NFS_SPECFILE_LNK: fattr->cf_mode |= S_IFLNK; - fattr->cf_dtype = DT_LNK; break; default: WARN_ON_ONCE(1); return false; } - return true; + goto out; } switch (tag) { + case IO_REPARSE_TAG_DFS: + case IO_REPARSE_TAG_DFSR: + case IO_REPARSE_TAG_MOUNT_POINT: + /* See cifs_create_junction_fattr() */ + fattr->cf_mode = S_IFDIR | 0711; + break; case IO_REPARSE_TAG_LX_SYMLINK: case IO_REPARSE_TAG_LX_FIFO: case IO_REPARSE_TAG_AF_UNIX: @@ -521,10 +522,11 @@ bool cifs_reparse_point_to_fattr(struct cifs_sb_info *cifs_sb, case IO_REPARSE_TAG_SYMLINK: case IO_REPARSE_TAG_NFS: fattr->cf_mode |= S_IFLNK; - fattr->cf_dtype = DT_LNK; break; default: return false; } +out: + fattr->cf_dtype = S_DT(fattr->cf_mode); return true; } |