[CRIU] [PATCH] dump: check the --file-locks flags when dumping.

lixiaoguang2 at huawei.com lixiaoguang2 at huawei.com
Thu Nov 26 10:54:00 MSK 2020


From: Xiaoguang Li <lixiaoguang2 at huawei.com>

When the --file-locks is not used, it still dump the file-locks
msg to image file. We need to check the --file-locks flags when dumping

Signed-off-by: Xiaoguang Li <lixiaoguang2 at huawei.com>
---
 criu/file-lock.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/criu/file-lock.c b/criu/file-lock.c
index 8be7589df..f80c2c305 100644
--- a/criu/file-lock.c
+++ b/criu/file-lock.c
@@ -91,6 +91,9 @@ static void fill_flock_entry(FileLockEntry *fle, int fl_kind, int fl_ltype)
 
 int dump_file_locks(void)
 {
+	if (!opts.handle_file_locks)
+		return 0;
+
 	FileLockEntry	 fle;
 	struct file_lock *fl;
 	int	ret = 0;
-- 
2.28.0.windows.1



More information about the CRIU mailing list