[CRIU] [PATCH 3/8] proc_parse: Invert supported VMA check

Pavel Emelyanov xemul at parallels.com
Fri Oct 10 12:02:01 PDT 2014


It's for more natural adding of new else-if branch for aio.

Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 proc_parse.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/proc_parse.c b/proc_parse.c
index bfc6d86..38f933a 100644
--- a/proc_parse.c
+++ b/proc_parse.c
@@ -487,8 +487,11 @@ int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list, bool use_map_file
 				goto err;
 			}
 
-			if (!S_ISREG(st_buf->st_mode) &&
-			    !(S_ISCHR(st_buf->st_mode) && st_buf->st_rdev == DEVZERO)) {
+			if (S_ISREG(st_buf->st_mode))
+				/* regular file mapping -- supported */;
+			else if (S_ISCHR(st_buf->st_mode) && (st_buf->st_rdev == DEVZERO))
+				/* devzero mapping -- also makes sense */;
+			else {
 				pr_err("Can't handle non-regular mapping on %d's map %#lx\n", pid, start);
 				goto err;
 			}
-- 
1.8.4.2




More information about the CRIU mailing list