diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 6fa859452..b7dd1580f 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2010-08-20 Corinna Vinschen + + * fhandler_disk_file.cc (fhandler_disk_file::fstatvfs): Revert usage + of get_stat_handle () to get_handle (). Add comment to explain why. + * syscalls.cc (statvfs): Drop using PC_KEEP_HANDLE. + 2010-08-19 Corinna Vinschen * external.cc (sync_wincwd): New function. diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index c860655d5..4054941eb 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -756,7 +756,11 @@ fhandler_disk_file::fstatvfs (struct statvfs *sfs) IO_STATUS_BLOCK io; FILE_FS_FULL_SIZE_INFORMATION full_fsi; FILE_FS_SIZE_INFORMATION fsi; - HANDLE fh = get_stat_handle (); + /* We must not use the stat handle here, even if it exists. The handle + has been opened with FILE_OPEN_REPARSE_POINT, thus, in case of a volume + mount point, it points to the FS of the mount point, rather than to the + mounted FS. */ + HANDLE fh = get_handle (); if (!fh) { diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index aaa4673a1..f13273c9f 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -2568,8 +2568,7 @@ statvfs (const char *name, struct statvfs *sfs) if (efault.faulted (EFAULT)) goto error; - if (!(fh = build_fh_name (name, PC_SYM_FOLLOW | PC_KEEP_HANDLE, - stat_suffixes))) + if (!(fh = build_fh_name (name, PC_SYM_FOLLOW, stat_suffixes))) goto error; if (fh->error ())