mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-22 09:39:13 +00:00
locks: skip 'lease correction' for non-regular files
Leases can be set only on regular files. Thus, as optimization we can skip attempts to find associated leases in 'correct_file_leases_type' for other fd types. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
8835e6973e
commit
2d7abe53fc
1 changed files with 7 additions and 2 deletions
|
|
@ -477,8 +477,13 @@ static int dump_one_file(struct pid *pid, int fd, int lfd, struct fd_opts *opts,
|
|||
if (note_file_lock(pid, fd, lfd, &p))
|
||||
return -1;
|
||||
|
||||
if (correct_file_leases_type(pid, fd, lfd))
|
||||
return -1;
|
||||
/* Lease can be set only on regular file */
|
||||
if (S_ISREG(p.stat.st_mode)) {
|
||||
int ret = correct_file_leases_type(pid, fd, lfd);
|
||||
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
p.fd_ctl = ctl; /* Some dump_opts require this to talk to parasite */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue