Current code hardcodes the path separator to backslash. The loop after it that switches the slashes direction only operates on the dfs prefix, not the whole path. Use CIFS_DIR_SEP instead.