Index: src/wp-admin/includes/file.php
===================================================================
--- src/wp-admin/includes/file.php	(revision 25309)
+++ src/wp-admin/includes/file.php	(working copy)
@@ -833,9 +833,10 @@
 function get_filesystem_method($args = array(), $context = false) {
 	$method = defined('FS_METHOD') ? FS_METHOD : false; //Please ensure that this is either 'direct', 'ssh', 'ftpext' or 'ftpsockets'
 
+	if ( !$context )
+		$context = WP_CONTENT_DIR;
+
 	if ( ! $method && function_exists('getmyuid') && function_exists('fileowner') ){
-		if ( !$context )
-			$context = WP_CONTENT_DIR;
 		$context = trailingslashit($context);
 		$temp_file_name = $context . 'temp-write-test-' . time();
 		$temp_handle = @fopen($temp_file_name, 'w');
@@ -847,6 +848,9 @@
 		}
  	}
 
+	if ( ! $method && get_site_option( 'fs_direct_ok' ) && is_writable( $context ) && is_writable( __FILE__ ) )
+		$method = 'direct';
+
 	if ( ! $method && isset($args['connection_type']) && 'ssh' == $args['connection_type'] && extension_loaded('ssh2') && function_exists('stream_get_contents') ) $method = 'ssh2';
 	if ( ! $method && extension_loaded('ftp') ) $method = 'ftpext';
 	if ( ! $method && ( extension_loaded('sockets') || function_exists('fsockopen') ) ) $method = 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread
Index: src/wp-admin/includes/update-core.php
===================================================================
--- src/wp-admin/includes/update-core.php	(revision 25309)
+++ src/wp-admin/includes/update-core.php	(working copy)
@@ -901,3 +901,66 @@
 	exit();
 }
 add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' );
+
+function _check_if_fs_direct_is_ok_in_future() {
+	global $wp_filesystem;
+
+	// If we're already using direct, nevermind!
+	if ( 'direct' == $wp_filesystem->method || 'direct' == get_filesystem_method() )
+		return;
+
+	$working_dir_local = WP_CONTENT_DIR . '/upgrade/';
+	// If we can't write to the created Working dir or ABSPATH, it doesn't matter to us ultimately
+	if ( ! is_writable( $working_dir_local ) || ! is_writable( ABSPATH ) )
+		return;
+
+	// Find the upgrade working directory.
+	$working_dir_ftp = $wp_filesystem->wp_content_dir();
+	if ( ! $working_dir_ftp )
+		return;
+
+	$working_dir_ftp .= 'upgrade/';
+
+	// Random Filenames for usage below
+	$random_filename = wp_unique_filename( $working_dir_local, 'test1.file' );
+	$random_filename2 = wp_unique_filename( $working_dir_local, 'test2.file' );
+	// Some random content that shouldn't match eachother
+	$random_content  = wp_generate_password() . '1';
+	$random_content2 = wp_generate_password() . '2';
+
+	// Create file1 via local file operations
+	$local_file_result = file_put_contents( $working_dir_local . $random_filename, $random_content );
+
+	// Create file2 via FTP
+	$remote_file_result = $wp_filesystem->put_contents( $working_dir_ftp . $random_filename2, $random_content );
+
+	// Write to random file1 by FTP
+	$local_file_writable_by_ftp = $wp_filesystem->put_contents( $working_dir_ftp . $random_filename, $random_content2 );
+
+	// Write to random file2 by local file operations
+	$remote_file_writable_by_local = file_put_contents( $working_dir_local . $random_filename2, $random_content2 );
+
+	// Verify contents of file1 and file2 match expected
+	$contents_OK1 = ( $random_content2 == file_get_contents( $working_dir_local . $random_filename ) );
+	$contents_OK2 = ( $random_content2 == file_get_contents( $working_dir_local . $random_filename2 ) );
+
+	// Verify FTP ownership of the two test files match (created via FTP, and via local file operations)
+	$listing = $wp_filesystem->dirlist( $working_dir_ftp );
+	$file_owner_matches = $listing && isset( $listing[ $random_filename ] ) && isset( $listing[ $random_filename2 ] ) && $listing[ $random_filename ]['owner'] === $listing[ $random_filename2 ]['owner'];
+
+	// Remove temporary files
+	@unlink( $working_dir_local . $random_filename  );
+	@unlink( $working_dir_local . $random_filename2 );
+	$wp_filesystem->delete( $working_dir_ftp . $random_filename  );
+	$wp_filesystem->delete( $working_dir_ftp . $random_filename2 );
+
+	$success = $local_file_result && $remote_file_result &&
+		$local_file_writable_by_ftp && $remote_file_writable_by_local &&
+		$contents_OK1 && $contents_OK2 &&
+		$file_owner_matches;
+
+	update_site_option( 'fs_direct_ok', $success );
+
+}
+// Attach to the upgrade-complete handler or something
+add_action( '_core_updated_successfully', '_check_if_fs_direct_is_ok_in_future', 1 );
\ No newline at end of file
