dump: check the --file-locks flags when dumping.

Submitted by lixiaoguang2@huawei.com on Nov. 26, 2020, 7:54 a.m.

Details

Message ID 20201126075400.1870-1-lixiaoguang2@huawei.com
State New
Series "dump: check the --file-locks flags when dumping."
Headers show

Commit Message

lixiaoguang2@huawei.com Nov. 26, 2020, 7:54 a.m.
From: Xiaoguang Li <lixiaoguang2@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@huawei.com>
---
 criu/file-lock.c | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

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;