Without -r flag file handles are opened, but file content is not
read. Treat dir file hanldes, similarly. without -r flag, open dir
file handle, but don't verify its content.
This is going to be used by tests for which dir content is changed
between encode and decode of dir file handle.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
if (!nlink) {
printf("open_by_handle(%s) opened an unlinked dir!\n", dname);
return EXIT_FAILURE;
- } else {
+ } else if (rd) {
/*
* Sanity check dir fd - expect to access orig file IFF
* it was not unlinked nor renamed.