Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
msdosfs rename report by kib
Browse files Browse the repository at this point in the history
  • Loading branch information
kostikbel committed Sep 22, 2021
1 parent c8692bf commit 2223ba2
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions 2021q3/msdosfs_rename.adoc
@@ -0,0 +1,26 @@
== Fixes for msdosfs_rename VOP

Contact: Konstantin Belousov <kib@FreeBSD.org>
Contact: Peter Holm <pho@FreeBSD.org>

Our msdosfs(5) implementation is old code, and it has a relatively
large legacy cost. In particular, even though it got fine-grained
locking and miscellaneous bugfixes over time, sometimes a big bug spot
is found in it.

Recently trasz@ found that msdosfs rename can be easily deadlocked.
Further code examination revealed a lot of issues with locking,
potential use after free, and filesystem structure corruption.

During this work, all known issues were fixed and msdosfs passes
enhanced stress2 suite of tests.

In particular, locking in the msdosfs rename code was reworked: we
need to lock up to four vnodes, and check one path to ensure that
rename does not create cicrular parent relations between directories.
For that, the locking procedure was copied from UFS rename, where all
vnodes except the first are locked in try-mode. Lockless relockup was
added to msdosfs and the directory path checker changed to non-blocking
mode.

Sponsor: The FreeBSD Foundation (kib' part of the work)

0 comments on commit 2223ba2

Please sign in to comment.