[PATCH 2/7] open_by_handle: verify dir content only with -r flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 src/open_by_handle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/open_by_handle.c b/src/open_by_handle.c
index f9dfefc..5b7a592 100644
--- a/src/open_by_handle.c
+++ b/src/open_by_handle.c
@@ -472,7 +472,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.
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux