[CRIU] [PATCH v3 11/16] files: check for file descriptor open callback

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Thu Dec 10 07:17:09 PST 2015


Artificial files can not have "open" callback, because there is nothing,
which has to open in reality, and there is no file descriptor to return.
Thus, check for open callback is required.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 files.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/files.c b/files.c
index 1a1c811..5df9e68 100644
--- a/files.c
+++ b/files.c
@@ -945,6 +945,9 @@ static int open_fd(int pid, struct fdinfo_list_entry *fle)
 	if (d->ops->post_open)
 		want_post_open_stage();
 
+	if (!d->ops->open)
+		return 0;
+
 	if (fle != file_master(d))
 		return 0;
 



More information about the CRIU mailing list