diff options
author | Amir Goldstein <amir73il@gmail.com> | 2018-01-23 22:59:06 +0200 |
---|---|---|
committer | Eryu Guan <eguan@redhat.com> | 2018-01-24 15:40:39 +0800 |
commit | 259cf891310f9a4519e74de2b66ba084dac27763 (patch) | |
tree | 8b4ceed327b8ba45f099d69b6b99db2fea3819e6 | |
parent | 04b7f069f1b750f1524e39cf48805f0246784a15 (diff) | |
download | xfstests-dev-259cf891310f9a4519e74de2b66ba084dac27763.tar.gz |
src/open_by_handle: verify dir content only with -r flag
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>
-rw-r--r-- | src/open_by_handle.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/open_by_handle.c b/src/open_by_handle.c index dbc5b0f4d0..9c13b2ab07 100644 --- a/src/open_by_handle.c +++ b/src/open_by_handle.c @@ -412,7 +412,7 @@ int main(int argc, char **argv) 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. |