\\dfs-server\namespace\link
\\fileserver\share\dir
CAP_DFS
.DIR\FOO
it should
instead use \HOST\SHARE\DIR\FOO
and set the SMB_FLAGS2_DFS
bit in
the SMB header.STATUS_PATH_NOT_COVERED
.genericity is achieved through structures of function pointers for operations.
superblocks are the metadata structures associated with mount points, they also store a pointer to the root directory entry.
struct super_operations {
struct inode *(*alloc_inode)(...);
void (*destroy_inode)(...);
void (*dirty_inode) (...);
int (*write_inode) (...);
int (*drop_inode) (...);
void (*evict_inode) (...);
void (*put_super) (...);
int (*show_path)(...);
int (*show_stats)(...);
/* ... */
};
struct dentry_operations {
int (*d_delete)(const struct dentry *);
int (*d_init)(...);
void (*d_release)(...);
void (*d_prune)(...);
void (*d_iput)(...);
char *(*d_dname)(...);
struct vfsmount *(*d_automount)(...);
int (*d_manage)(...);
struct dentry *(*d_real)(...);
/* ... */
};
struct inode_operations {
struct dentry * (*lookup) (...);
const char * (*get_link) (...);
int (*permission) (...);
struct posix_acl * (*get_acl)(...);
int (*readlink) (...);
int (*create) (...);
int (*link) (...);
int (*unlink) (...);
int (*symlink) (...);
int (*mkdir) (...);
/* ... */
};
struct file_operations {
loff_t (*llseek) (...);
ssize_t (*read) (...);
ssize_t (*write) (...);
uint (*poll) (...);
long (*unlocked_ioctl) (...);
long (*compat_ioctl) (...);
int (*mmap) (...);
int (*open) (...);
int (*flush) (...);
/* ... */
};
struct smb_version_operations {
int (*sess_setup)(...);
int (*logoff)(...);
int (*tree_connect)(...);
int (*tree_disconnect)(...);
int (*get_dfs_refer)(...);
/* ... */
};
The DFS querying can be triggered in 2 ways:
In the later, cifs.ko marks the DFS link as a directory.
AUTOMOUNT
flag and is
actually "empty".AUTOMOUNT
get_dfs_referral()
CIFS operation was only
implemented for SMB1. 284316dd42a2 CIFS: Fix sparse warnings
9d49640a21bf CIFS: implement get_dfs_refer for SMB2+
f0712928be1a CIFS: use DFS pathnames in SMB2+ Create requests
b9043cc5b99e CIFS: set signing flag in SMB2+ TreeConnect if needed
7f9f6d2ec514 CIFS: let ses->ipc_tid hold smb2 TreeIds
51146625f34b CIFS: add use_ipc flag to SMB2_ioctl()
268a635d414d CIFS: add build_path_from_dentry_optional_prefix()
4ecce920e13a CIFS: move DFS response parsing out of SMB1 code
build_path_from_dentry()
prefixes the path with the tree name
(host + share) when connected to a DFS share, as required by SMB1 on
packets containing paths. @@ -92,7 +103,7 @@ build_path_from_dentry(struct dentry *direntry)
unsigned seq;
dirsep = CIFS_DIR_SEP(cifs_sb);
- if (tcon->Flags & SMB_SHARE_IS_IN_DFS)
+ if (prefix)
dfsplen = strnlen(tcon->treeName, MAX_TREE_SIZE + 1);
else
dfsplen = 0;
NO_FILE_ID
).use_ipc
flag to SMB2_ioctl()
.get_dfs_refer