Commit de08cb7
Fix inode eviction and sync writeback deadlock on Linux
If inode eviction and sync writeback happen on the same inode at the
same time, inode eviction will set I_FREEING and wait for sync
writeback, and sync writeback may eventually calls zfs_get_data and loop
in zfs_zget forever because igrab cannot succeed with I_FREEING, thus
causing deadlock.
To fix this, in zfs_get_data we call a variant of zfs_zget where we
bailout on loop if I_SYNC flag is set, and force the caller to wait for
txg sync.
Signed-off-by: Chunwei Chen <david.chen@nutanix.com>
Fixes openzfs#7964
Fixes openzfs#94301 parent 455c361 commit de08cb7
File tree
4 files changed
+40
-3
lines changed- include/sys
- module
- os
- freebsd/zfs
- linux/zfs
- zfs
4 files changed
+40
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
279 | 280 | | |
280 | 281 | | |
281 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1081 | 1081 | | |
1082 | 1082 | | |
1083 | 1083 | | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
1084 | 1091 | | |
1085 | 1092 | | |
1086 | 1093 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1050 | 1050 | | |
1051 | 1051 | | |
1052 | 1052 | | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
1053 | 1060 | | |
1054 | 1061 | | |
1055 | 1062 | | |
1056 | 1063 | | |
1057 | 1064 | | |
1058 | 1065 | | |
1059 | 1066 | | |
| 1067 | + | |
1060 | 1068 | | |
1061 | 1069 | | |
1062 | 1070 | | |
| |||
1115 | 1123 | | |
1116 | 1124 | | |
1117 | 1125 | | |
1118 | | - | |
| 1126 | + | |
1119 | 1127 | | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
1120 | 1138 | | |
1121 | 1139 | | |
1122 | 1140 | | |
| |||
1126 | 1144 | | |
1127 | 1145 | | |
1128 | 1146 | | |
1129 | | - | |
| 1147 | + | |
1130 | 1148 | | |
1131 | 1149 | | |
1132 | 1150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1342 | 1342 | | |
1343 | 1343 | | |
1344 | 1344 | | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
1345 | 1356 | | |
1346 | 1357 | | |
1347 | 1358 | | |
1348 | | - | |
| 1359 | + | |
1349 | 1360 | | |
1350 | 1361 | | |
1351 | 1362 | | |
| |||
0 commit comments