Skip to content

Instantly share code, notes, and snippets.

@lundman
Last active February 14, 2018 08:58
Show Gist options
  • Save lundman/a26310e58cfba1a2dd7a38526104631a to your computer and use it in GitHub Desktop.
Save lundman/a26310e58cfba1a2dd7a38526104631a to your computer and use it in GitHub Desktop.
hardlink corrective
@sanjeevbagewadi
Copy link

Wondering how we would handle the following case :

  • cd /zfs-fs1
  • mkdir dir1
  • mkdir dir2
  • touch dir1/f1
  • ln dir1/f1 dir1/f1-hlink-1
  • ln dir1/f1 dir2/f1-hlink-2 (at this point f1 has SA_ZPL_PARENT pointing to dir2)
  • rm -rf dir2
  • mkdir dir2 (lets assume, it gets the same dnode as older dir2)

And then the above fix kicks in and finds that f1 has SA_ZPL_PARENT pointing to dir2
and dir2 is present. Would it wrongly assume that dir2 has a valid hardlink dentry pointing to f1 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment