FreeBSD Bugzilla – Attachment 218960 Details for
Bug 249871
NFSv4 faulty directory listings under heavy load
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
small test program that reads a directory and prints out d_off
rdir.c (text/plain), 883 bytes, created by
Rick Macklem
on 2020-10-22 00:11:48 UTC
(
hide
)
Description:
small test program that reads a directory and prints out d_off
Filename:
MIME Type:
Creator:
Rick Macklem
Created:
2020-10-22 00:11:48 UTC
Size:
883 bytes
patch
obsolete
>/* > * Check for directory offsets that are not monotonically increasing. > */ >#include <stdio.h> >#include <dirent.h> >#include <err.h> >#include <stdbool.h> >#include <stdlib.h> >#include <unistd.h> > >int >main(int argc, char **argv) >{ > DIR *dirp; > struct dirent *dent; > off_t oldoff; > int c; > bool verbose; > > verbose = false; > while ((c = getopt(argc, argv, "v")) != -1) > switch (c) { > case 'v': > verbose = true; > break; > default: > errx(1, "Usage: rdir [-v] <directory>"); > } > argc -= optind; > argv += optind; > if (argc != 1) > errx(1, "Usage: rdir [-v] <directory>"); > dirp = opendir(argv[0]); > if (dirp == NULL) > errx(1, "Cannot open %s", argv[1]); > oldoff = 0; > while ((dent = readdir(dirp)) != NULL) { > if (verbose) > printf("%jd\n", (intmax_t)dent->d_off); > if (dent->d_off <= oldoff) { > printf("Not monotonically increasing\n"); > exit(0); > } > oldoff = dent->d_off; > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 249871
:
218479
| 218960 |
219047