Skip to content

Conversation

@adamsitnik
Copy link
Member

@adamsitnik adamsitnik commented May 18, 2022

fixes #61175

context: #61175 (comment)

the fix is relatively safe as the maximum know value that we support:

can be represented using 32 bit value

@adamsitnik adamsitnik added this to the 7.0.0 milestone May 18, 2022
@adamsitnik adamsitnik requested review from danmoseley and tmds May 18, 2022 11:44
@ghost ghost assigned adamsitnik May 18, 2022
@ghost
Copy link

ghost commented May 18, 2022

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

fixes #61175

context: #61175 (comment)

Author: adamsitnik
Assignees: -
Labels:

area-System.IO

Milestone: 7.0.0

@jkotas
Copy link
Member

jkotas commented May 18, 2022

the fix is relatively safe as the maximum know value that we support can be represented using 32 bit value

Would it be better to change the UnixFileSystemTypes enum type and the return value of SystemNative_GetFileSystemType to uint then?

@adamsitnik
Copy link
Member Author

Would it be better to change the UnixFileSystemTypes enum type and the return value of SystemNative_GetFileSystemType to uint then?

In a long term yes. Here I wanted to make the change as small as possible to make it easier to review when backporting to 6.0.

Copy link
Member

@danmoseley danmoseley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable.

@danmoseley
Copy link
Member

Should the type of UnixFileSystemTypes be uint? Would catch if we try to add larger values.

@adamsitnik adamsitnik force-pushed the fileSystemTypeFix branch from 92d05e5 to d5d9cb9 Compare May 18, 2022 14:54
@adamsitnik adamsitnik force-pushed the fileSystemTypeFix branch from d5d9cb9 to cb3017e Compare May 18, 2022 14:55
@adamsitnik adamsitnik requested a review from jkotas May 18, 2022 14:56
// which got deprecated in macOS 10.6, in favor of statfs
while ((statfsRes = fstatfs(ToFileDescriptor(fd), &statfsArgs)) == -1 && errno == EINTR) ;
return statfsRes == -1 ? (int64_t)-1 : (int64_t)statfsArgs.f_type;
return statfsRes == -1 ? 0 : (uint32_t)statfsArgs.f_type; // disregard the upper bytes #61175
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return statfsRes == -1 ? 0 : (uint32_t)statfsArgs.f_type; // disregard the upper bytes #61175
return statfsRes == -1 ? 0 : (uint32_t)statfsArgs.f_type; // disregard the upper bytes https://github.com/dotnet/runtime/issues/61175

Co-authored-by: Tom Deseyn <tom.deseyn@gmail.com>
@adamsitnik adamsitnik merged commit cb1fd54 into dotnet:main May 26, 2022
@adamsitnik adamsitnik deleted the fileSystemTypeFix branch May 26, 2022 20:33
@ghost ghost locked as resolved and limited conversation to collaborators Jun 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET 6.0.0-rc.2 on Raspberry Pi cannot write to writable network file

5 participants