Skip to content

Change in FileSystem.Unix.File.Move possibly introduced bug #34330

Closed

Description

@alexischr

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.

The line:
https://github.com/dotnet/corefx/pull/40611/files#r401020707

The Mono discussion:
https://github.com/mono/corefx/pull/395/files#r400813984

//cc original reviewers @stephentoub @carlossanlop @JeremyKuhne

Activity

  1. added
    untriaged
    on Mar 31, 2020
  2. alexischr commented on Mar 31, 2020

    @alexischr
    ContributorAuthor
  3. danmoseley commented on Mar 31, 2020

    @danmoseley
    Contributor

    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)?

  4. mdh1418 commented on Mar 31, 2020

    @mdh1418
    Member

    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?

  5. baulig commented on Mar 31, 2020

    @baulig
    Contributor

    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.

  6. danmoseley commented on Mar 31, 2020

    @danmoseley
    Contributor

    Yup. fully agree, we should add it back. Was just thinking aloud why we had not seen a problem yet.

  7. danmoseley commented on Mar 31, 2020

    @danmoseley
    Contributor

    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.

  8. ghost locked as resolved and limited conversation to collaborators on Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.IOuntriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions