[newlib-cygwin] Fix EIO error accessing certain (OS X SMB?) drives

Corinna Vinschen corinna@sourceware.org
Wed Oct 21 10:01:00 GMT 2015


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=713161b28b85b7ce05c27a46c52b0780b96047ce

commit 713161b28b85b7ce05c27a46c52b0780b96047ce
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed Oct 21 12:01:11 2015 +0200

    Fix EIO error accessing certain (OS X SMB?) drives
    
    	* path.cc (symlink_info::check_reparse_point): Don't generate an EIO
    	error if NtFsControlFile returns STATUS_NOT_A_REPARSE_POINT.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/ChangeLog     | 5 +++++
 winsup/cygwin/path.cc       | 8 +++++++-
 winsup/cygwin/release/2.3.0 | 3 +++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 59c7ca1..5d2675d 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-21  Corinna Vinschen  <corinna@vinschen.de>
+
+	* path.cc (symlink_info::check_reparse_point): Don't generate an EIO
+	error if NtFsControlFile returns STATUS_NOT_A_REPARSE_POINT.
+
 2015-09-23  Evgeny Grin  <k2k@yandex.ru>
 
 	* fhandler_socket.cc (fhandler_socket::wait_for_events): Fix compiler
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 89dbdab..488d4e6 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2289,7 +2289,13 @@ symlink_info::check_reparse_point (HANDLE h, bool remote)
     {
       debug_printf ("NtFsControlFile(FSCTL_GET_REPARSE_POINT) failed, %y",
 		    status);
-      set_error (EIO);
+      /* When accessing the root dir of some remote drives (observed with
+	 OS X shares), the FILE_ATTRIBUTE_REPARSE_POINT flag is set, but
+	 the followup call to NtFsControlFile(FSCTL_GET_REPARSE_POINT)
+	 returns with STATUS_NOT_A_REPARSE_POINT.  That's quite buggy, but
+	 we cope here with this scenario by not setting an error code. */
+      if (status != STATUS_NOT_A_REPARSE_POINT)
+	set_error (EIO);
       return 0;
     }
   if (rp->ReparseTag == IO_REPARSE_TAG_SYMLINK)
diff --git a/winsup/cygwin/release/2.3.0 b/winsup/cygwin/release/2.3.0
index 2f3adec..f2391a9 100644
--- a/winsup/cygwin/release/2.3.0
+++ b/winsup/cygwin/release/2.3.0
@@ -36,3 +36,6 @@ Bug Fixes
 - Fix a potential crash in advisory file locking due to usage of stack space
   out of scope.
   Addresses: https://cygwin.com/ml/cygwin/2015-09/msg00079.html
+
+- Fix EIO error accessing certain (OS X SMB?) drives
+  Addresses: https://cygwin.com/ml/cygwin/2015-09/msg00229.html



More information about the Cygwin-cvs mailing list