You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Change in FileSystem.Unix.File.Move possibly introduced bug #34330
While porting dotnet/corefx#40611 to Mono, @baulig noticed a deleted line
checking the Dev fields of the struct FileStatus outputs of LStat for the source and destination files. No discussion was made about that change, which seems incorrect, and the comment on the next line even alludes to the removed check.
We still have the sourceStat.Ino == destStat.Ino check -- am I right in guessing that inodes of two files on different devices could theoretically be the same, but it's very unlikely (hence we didn't see any issue)?
Right, the inode check is still there. Wouldn't adding the device check back in ensure that the code is functioning as we intend it to, rather than introduce an undesired case where inodes happen to be the same on different devices?
When I reviewed the Mono PR and saw this, my thinking was that we're introducing a bug that will be extremely rare and thus a total nightmare to track down when it does happen. Even more so because when it does happen, the scenario will only exist on the customer's system and be unreproducible by any of us.
Activity
alexischr commentedon Mar 31, 2020
cc @mdh1418
danmoseley commentedon Mar 31, 2020
We still have the
sourceStat.Ino == destStat.Inocheck -- am I right in guessing that inodes of two files on different devices could theoretically be the same, but it's very unlikely (hence we didn't see any issue)?mdh1418 commentedon Mar 31, 2020
Right, the inode check is still there. Wouldn't adding the device check back in ensure that the code is functioning as we intend it to, rather than introduce an undesired case where inodes happen to be the same on different devices?
baulig commentedon Mar 31, 2020
When I reviewed the Mono PR and saw this, my thinking was that we're introducing a bug that will be extremely rare and thus a total nightmare to track down when it does happen. Even more so because when it does happen, the scenario will only exist on the customer's system and be unreproducible by any of us.
danmoseley commentedon Mar 31, 2020
Yup. fully agree, we should add it back. Was just thinking aloud why we had not seen a problem yet.
danmoseley commentedon Mar 31, 2020
One of you want to throw up the PR? If not then area owner can but I think this is a one line PR with perhaps no reasonable test possible for it.