For non-Windows hosts, the HGFS server will not be able to
handle cross volume renames returning the error
HGFS_STATUS_GENERIC_ERROR. A new error should be returned and
mapped to the Windows system status STATUS_NOT_SAME_DEVICE
and EXDEV by the guest file system client. This will cause
the application (Windows Explorer, Posix mv) to break the move
file operation into a copy and delete file operations.
Windows HGFS server does not currently return this error at
all, and furthermore, handles the cross volume rename
operations internally. However, since non-Windows hosts and
guests both use the new HGFS_STATUS_NOT_SAME_VOLUME error
for this rename error, the Windows server could be later modified
to return this too for consistency and then all guest clients
can let the guest application handle it accordingly.
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
return HGFS_STATUS_OPERATION_NOT_SUPPORTED;
case ERROR_INVALID_PARAMETER:
return HGFS_STATUS_INVALID_PARAMETER;
+ case ERROR_NOT_SAME_DEVICE:
+ return HGFS_STATUS_NOT_SAME_DEVICE;
case HGFS_INTERNAL_STATUS_ERROR:
default:
return HGFS_STATUS_GENERIC_ERROR;
return HGFS_STATUS_NAME_TOO_LONG;
case EPARAMETERNOTSUPPORTED:
return HGFS_STATUS_INVALID_PARAMETER;
+ case EXDEV:
+ return HGFS_STATUS_NOT_SAME_DEVICE;
case HGFS_INTERNAL_STATUS_ERROR:
default:
return HGFS_STATUS_GENERIC_ERROR;
HGFS_STATUS_OPERATION_NOT_SUPPORTED,
HGFS_STATUS_NAME_TOO_LONG,
HGFS_STATUS_INVALID_PARAMETER,
+ HGFS_STATUS_NOT_SAME_DEVICE,
/*
* Following error codes are for V4 and above protocol only.
* Server must never retun these codes for legacy clients.
case HGFS_STATUS_GENERIC_ERROR:
return -EIO;
+ case HGFS_STATUS_NOT_SAME_DEVICE:
+ return -EXDEV;
+
default:
LOG(10, (KERN_DEBUG "VMware hgfs: HgfsStatusConvertToLinux: unknown "
"error: %u\n", hgfsStatus));