diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-05-23 21:22:18 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-05-23 21:22:18 +0400 |
commit | 6afd63010691ff7a1a3caa7d96b23b1f390a719a (patch) | |
tree | 501a8c3a8c87acc45503ba752a574e875bdca2fc /winsup/cygwin | |
parent | e765b3c0adf2d1a6133b52ce7cb2e71a74811756 (diff) |
* fhandler_disk_file.cc (fhandler_disk_file::opendir): Don't try to
use FileIdBothDirectoryInformation on NFS shares. Fix comment to
explain why.
* path.cc (symlink_info::check): Reinstantiate no_ea. Use in
erroneously changed condition.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 12 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 18 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 9 |
3 files changed, 25 insertions, 14 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b8519ded9..b6e1b0aeb 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2008-05-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Don't try to + use FileIdBothDirectoryInformation on NFS shares. Fix comment to + explain why. + * path.cc (symlink_info::check): Reinstantiate no_ea. Use in + erroneously changed condition. + 2008-05-23 Christopher Faylor <me+cygwin@cgf.cx> * mount.cc (find_root_from_cygwin_dll): New function factored from @@ -19,7 +27,7 @@ * path.cc (symlink_info::check): Remove unused variable. -2008-05-22 Corinna Vinschen <corinna@vinschen.de> +2008-05-23 Corinna Vinschen <corinna@vinschen.de> * shared.cc (open_shared): Fix comments. Fix a condition which has been overlooked to revert to its old state in change from 2008-04-18. @@ -30,7 +38,7 @@ loop. Set to NULL on first STATUS_EAS_NOT_SUPPORTED. Align comments. Fix formatting. -2008-05-22 Corinna Vinschen <corinna@vinschen.de> +2008-05-23 Corinna Vinschen <corinna@vinschen.de> * fhandler_disk_file.cc (fhandler_disk_file::readdir): Eliminate compiler warning. diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 6fa6e5374..66f1fcc3c 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -1569,19 +1569,21 @@ fhandler_disk_file::opendir (int fd) FileIdBothDirectoryInformation only on filesystems supporting persistent ACLs, FileDirectoryInformation otherwise. - On older NFS clients (up to SFU 3.5), dangling symlinks - are hidden from directory queries, unless you use the - FileNamesInformation info class. Nevertheless, we try - FileIdBothDirectoryInformation first. On newer NFS clients - it works fine, on the older ones it returns "invalid info - class". So we can stick to the above explained mechanism. */ + NFS clients hide dangling symlinks from directory queries, + unless you use the FileNamesInformation info class. + On newer NFS clients (>=Vista) FileIdBothDirectoryInformation + works fine, but only if the NFS share is mounted to a drive + letter. TODO: We don't test that here for now, but it might + be worth to test if there's a speed gain in using + FileIdBothDirectoryInformation, because it doesn't require to + open the file to read the inode number. */ if (pc.hasgood_inode ()) { dir->__flags |= dirent_set_d_ino; - if (wincap.has_fileid_dirinfo ()) - dir->__flags |= dirent_get_d_ino; if (pc.fs_is_nfs ()) dir->__flags |= dirent_nfs_d_ino; + else if (wincap.has_fileid_dirinfo ()) + dir->__flags |= dirent_get_d_ino; } } if (fd >= 0) diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index dd7ba44b3..30688a866 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2342,7 +2342,7 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt, tp.u_get (&upath); InitializeObjectAttributes (&attr, &upath, OBJ_CASE_INSENSITIVE, NULL, NULL); - void *eabuf = &nfs_aol_ffei; + PVOID eabuf = &nfs_aol_ffei; ULONG easize = sizeof nfs_aol_ffei; while (suffix.next ()) @@ -2350,6 +2350,7 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt, FILE_BASIC_INFORMATION fbi; NTSTATUS status; IO_STATUS_BLOCK io; + bool no_ea = false; error = 0; get_nt_native_path (suffix.path, upath, pflags & MOUNT_ENC); @@ -2373,6 +2374,7 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt, /* No right to access EAs or EAs not supported? */ if (status == STATUS_ACCESS_DENIED || status == STATUS_EAS_NOT_SUPPORTED) { + no_ea = true; /* If EAs are not supported, there's no sense to check them again whith suffixes attached. So we set eabuf/easize to 0 here once. */ if (status == STATUS_EAS_NOT_SUPPORTED) @@ -2380,8 +2382,7 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt, eabuf = NULL; easize = 0; } - status = NtCreateFile (&h, - READ_CONTROL | FILE_READ_ATTRIBUTES, + status = NtCreateFile (&h, READ_CONTROL | FILE_READ_ATTRIBUTES, &attr, &io, NULL, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_VALID_FLAGS, FILE_OPEN, FILE_OPEN_REPARSE_POINT @@ -2526,7 +2527,7 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt, /* If the file could be opened with FILE_READ_EA, and if it's on a NFS share, check if it's a symlink. Only files can be symlinks (which can be symlinks to directories). */ - else if (!eabuf && !(fileattr & FILE_ATTRIBUTE_DIRECTORY) && fs.is_nfs ()) + else if (!no_ea && !(fileattr & FILE_ATTRIBUTE_DIRECTORY) && fs.is_nfs ()) { res = check_nfs_symlink (h); if (!res) |