`CopyOnWriteLinkSupportedBetweenPaths` throws for a source on a mapped network drive
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- csharp
- Lĩnh vực
- operating-systems
Hướng nghiên cứu
Bắt đầu với WindowsCopyOnWriteFilesystem.cs, đặc biệt là CopyOnWriteLinkSupportedBetweenPaths, và đọc VolumeInfoCache.cs quanh GetVolumeForPath. Tái hiện lệnh gọi với một tệp trên ổ đĩa Q: được ánh xạ; hoàn tất khi phương thức trả về false thay vì ném ngoại lệ khi không tồn tại volume nào đã biết.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The XML documentation of ICopyOnWriteFilesystem.CopyOnWriteLinkSupportedBetweenPaths says:
Determines whether a copy-on-write link can be created between the provided paths.
Returns: True if a link can be created, false if it cannot.
A mapped network drive does not support a link. The expected result is therefore false, not an exception. However, the method throws:
System.ArgumentException: No known volume information for 'Q:\share\big-installer.zip'. If the drive was added recently you may need to recreate the filesystem cache.
at Microsoft.CopyOnWrite.Windows.VolumeInfoCache.GetVolumeForPath(String path) in D:\CoW\lib\Windows\VolumeInfoCache.cs:line 102
at Microsoft.CopyOnWrite.Windows.WindowsCopyOnWriteFilesystem.CopyOnWriteLinkSupportedBetweenPaths(String source, String destination, Boolean pathsAreFullyResolved) in D:\CoW\lib\Windows\WindowsCopyOnWriteFilesystem.cs:line 46
Q: is a mapped network drive. VolumeInfoCache holds the local volumes only, so GetVolumeForPath finds no volume for the path and throws.
Steps to reproduce
- Map a network share to a drive letter, for example
Q:. - Put a file on that share.
- Call
CopyOnWriteLinkSupportedBetweenPathswith the file onQ:as the source.
Result: the call throws ArgumentException.
Expected: the call returns false.
Suggested fix
Return false for a path with no known volume, in the same way that the volume enumeration ignores a volume that gives an error. The release history shows this pattern for other volume errors:
- 0.3.7: ignore
ACCESS_DENIEDon volume enumeration. - 0.3.9 to 0.3.12: ignore
FILE_NOT_FOUND,ERROR_NO_SUCH_DEVICE, and
ERROR_DEV_NOT_EXISTon volume enumeration. - 0.4.2: ignore any volume that gives an error.
A mapped network drive is arguably the next case in this series.
Version
CopyOnWrite0.5.0 (NuGet)- .NET 8, Windows 11
- Ngôn ngữ chính
- C#
- Star
- 153
- Fork
- 9
- Merge trung bình
- 10 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/CopyOnWrite
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
microsoft/CopyOnWrite#24 · 15 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
microsoft/CopyOnWrite#19 ·
-
Create clone using shadow copy? Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
microsoft/CopyOnWrite#7 ·
Tất cả issue của microsoft/CopyOnWrite
Issue tương tự
-
type/automation type/tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
t/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
ci-failure-cause test-failure
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
area:auth FE mvp P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
klasolsson81/jobbliggaren#1788 ·