Commit f844b13
Jeff Xie
Treat NFS ESTALE fds as unlinked for +L selection
On NFS clients, a file can be deleted on the server while still
referenced by an open fd on the client. In such cases, stat(2)/lstat(2)
on /proc/<pid>/fd/<n> may fail with ESTALE ("Stale file handle").
lsof's +L selection is commonly used to find open-but-unlinked files,
but ESTALE fds were not selectable. Record per-fd errno from statsafely()
/ lstatsafely() and, when +L selection is enabled (SELNLINK), mark the
file as matching and annotate NAME with " (STALE)".
This helps identify NFS open-but-deleted/stale file handles using existing
+L workflows without introducing new command-line options.
Signed-off-by: Jeff Xie <xiehuan09@gmail.com>1 parent d1702af commit f844b13
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
917 | 917 | | |
918 | 918 | | |
919 | 919 | | |
| 920 | + | |
| 921 | + | |
920 | 922 | | |
921 | 923 | | |
922 | 924 | | |
| |||
1206 | 1208 | | |
1207 | 1209 | | |
1208 | 1210 | | |
| 1211 | + | |
1209 | 1212 | | |
1210 | 1213 | | |
1211 | 1214 | | |
1212 | 1215 | | |
1213 | 1216 | | |
1214 | 1217 | | |
1215 | 1218 | | |
| 1219 | + | |
1216 | 1220 | | |
1217 | 1221 | | |
1218 | 1222 | | |
| |||
1353 | 1357 | | |
1354 | 1358 | | |
1355 | 1359 | | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
1356 | 1366 | | |
1357 | 1367 | | |
1358 | 1368 | | |
| |||
0 commit comments