g_cfg->win_vol_name.copy(VolumeNameBuffer, VolumeNameSize);
*VolumeSerialNumber = g_cfg->win_vol_serial;
- *MaximumComponentLength = 256;
+ *MaximumComponentLength = g_cfg->max_path_len;
+
*FileSystemFlags = FILE_CASE_SENSITIVE_SEARCH |
FILE_CASE_PRESERVED_NAMES |
FILE_SUPPORTS_REMOTE_STORAGE |
}
}
+ if (g_cfg->max_path_len > 260) {
+ dout(0) << "maximum path length set to " << g_cfg->max_path_len
+ << ". Some Windows utilities may not be able to handle "
+ << "paths that exceed MAX_PATH (260) characters. "
+ << "CreateDirectoryW, used by Powershell, has also been "
+ << "observed to fail when paths exceed 16384 characters."
+ << dendl;
+ }
+
atexit(unmount_atexit);
dout(0) << "Mounted cephfs directory: " << g_cfg->root_path.c_str()
<<". Mountpoint: " << to_string(g_cfg->mountpoint) << dendl;
--removable use a removable drive
--win-vol-name arg The Windows volume name. Default: Ceph - <fs_name>.
--win-vol-serial arg The Windows volume serial number. Default: <fs_id>.
+ --max-path-len The value of the maximum path length. Default: 256.
Unmap options:
-l [ --mountpoint ] arg mountpoint (path or drive letter) (e.g -l x).
std::string mountpoint;
std::string win_vol_name;
std::string win_vol_serial;
+ std::string max_path_len;
int thread_count;
} else if (ceph_argparse_witharg(args, i, &win_vol_serial,
"--win-vol-serial", (char *)NULL)) {
cfg->win_vol_serial = std::stoul(win_vol_serial);
+ } else if (ceph_argparse_witharg(args, i, &max_path_len,
+ "--max-path-len", (char*)NULL)) {
+ unsigned long max_path_length = std::stoul(max_path_len);
+
+ if (max_path_length > 32767) {
+ *err_msg << "ceph-dokan: maximum path length should not "
+ << "exceed " << 32767;
+ return -EINVAL;
+ }
+
+ if (max_path_length < 256) {
+ *err_msg << "ceph-dokan: maximum path length should not "
+ << "have a value lower than 256";
+ return -EINVAL;
+ }
+
+ cfg->max_path_len = max_path_length;
} else if (ceph_argparse_flag(args, i, "--current-session-only", (char *)NULL)) {
cfg->current_session_only = true;
} else if (ceph_argparse_witharg(args, i, &thread_count,