]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix renames across volumes for HGFS Windows guests
authorVMware, Inc <>
Mon, 26 Apr 2010 18:26:50 +0000 (11:26 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Tue, 27 Apr 2010 03:48:54 +0000 (20:48 -0700)
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>
open-vm-tools/lib/hgfs/hgfsUtil.c
open-vm-tools/lib/include/hgfs.h
open-vm-tools/modules/linux/vmhgfs/fsutil.c

index 56b2b32361a7dbc86ede8399a4a5d39000091afa..4ad5815e97ef8fd65735f1eb86377d80c415ff5c 100644 (file)
@@ -231,6 +231,8 @@ HgfsConvertFromInternalStatus(HgfsInternalStatus status) // IN
       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;
@@ -272,6 +274,8 @@ HgfsConvertFromInternalStatus(HgfsInternalStatus status) // IN
       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;
index b3d7b23460a9d800bb02aaa348ecbdbcbba7712c..ffa5e36de088714e63dbe2f4040e833f52b4574e 100644 (file)
@@ -169,6 +169,7 @@ typedef enum {
    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.
index 4c0b9fdba2731b53874d45e0a94a5e53ed92d43e..c9b01c833e5a291f61a2efa83edb377b10638959 100644 (file)
@@ -1540,6 +1540,9 @@ HgfsStatusConvertToLinux(HgfsStatus hgfsStatus) // IN: Status code to convert
    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));