Summary: | self-referential nullfs mount over tmpfs in combination with MNT_UPDATE results in a hang | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Alex S <iwtcex> | ||||
Component: | kern | Assignee: | freebsd-fs (Nobody) <fs> | ||||
Status: | New --- | ||||||
Severity: | Affects Only Me | CC: | arrowd, dfr, kevans, pho | ||||
Priority: | --- | ||||||
Version: | 14.0-RELEASE | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Let's start with dfr@, since the sample in question is specifically null-mounting a file over itself. With the deadlock.c attached, I hit it best with a stupid simple loop: ``` #!/bin/sh iteration=1 while true; do echo "Iteration $iteration" ./a.out iteration=$((iteration + 1)) done ``` Took me about 15 tries. When it deadlocks on my machine, it's in the nmount(2) that would be null-mounting the file over itself rather than the follow-up MNT_UPDATE of the tmpfs mount holding it. Oh, let's CC pho@ too, as this might have some good inspiration for his testing... |
Created attachment 246821 [details] deadlock.c Update the issue title as you see fit. The attached repro works in 14 and CURRENT. I admit mounting a path on itself is a bit silly (and probably should be forbidden), but the hang is still worth a look.