Commit f2010f8
committed
Fix snapshot automount race causing AVL tree panic
Multiple threads racing to automount the same snapshot can both pass
the initial mount check and attempt to add identical AVL tree entries,
triggering a VERIFY() panic in avl_add().
The fix adds a recheck after acquiring the write lock to detect if
another thread already added the entry during the mount operation.
If found, the duplicate is freed instead of causing a panic.
Reproducible with parallel access to a fresh snapshot:
ls /mnt/test/.zfs/snapshot/snap1/ &
ls /mnt/test/.zfs/snapshot/snap1/ &
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>1 parent e63d026 commit f2010f8
1 file changed
+19
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1291 | 1291 | | |
1292 | 1292 | | |
1293 | 1293 | | |
1294 | | - | |
1295 | | - | |
1296 | | - | |
1297 | | - | |
1298 | | - | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
1299 | 1313 | | |
1300 | 1314 | | |
1301 | 1315 | | |
| |||
0 commit comments