mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-21 01:06:58 +00:00
fd: Relax file master checking in open and post_open
pid == pid && fd == fd equals fle == fle :) Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
cc41192f10
commit
1ea03bf80c
1 changed files with 3 additions and 8 deletions
11
files.c
11
files.c
|
|
@ -381,7 +381,6 @@ static int send_fd_to_self(int fd, struct fdinfo_list_entry *fle, int *sock)
|
|||
static int post_open_fd(int pid, struct fdinfo_list_entry *fle)
|
||||
{
|
||||
struct file_desc *d = fle->desc;
|
||||
struct fdinfo_list_entry *flem;
|
||||
|
||||
if (!d->ops->post_open)
|
||||
return 0;
|
||||
|
|
@ -389,11 +388,10 @@ static int post_open_fd(int pid, struct fdinfo_list_entry *fle)
|
|||
if (is_service_fd(fle->fe->fd, CTL_TTY_OFF))
|
||||
return d->ops->post_open(d, fle->fe->fd);
|
||||
|
||||
flem = file_master(d);
|
||||
if ((flem->pid != pid) || (fle->fe->fd != flem->fe->fd))
|
||||
if (fle != file_master(d))
|
||||
return 0;
|
||||
|
||||
return d->ops->post_open(d, flem->fe->fd);
|
||||
return d->ops->post_open(d, fle->fe->fd);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -430,10 +428,8 @@ static int open_fd(int pid, struct fdinfo_list_entry *fle)
|
|||
{
|
||||
struct file_desc *d = fle->desc;
|
||||
int new_fd;
|
||||
struct fdinfo_list_entry *flem;
|
||||
|
||||
flem = file_master(d);
|
||||
if ((flem->pid != pid) || (fle->fe->fd != flem->fe->fd))
|
||||
if (fle != file_master(d))
|
||||
return 0;
|
||||
|
||||
new_fd = d->ops->open(d);
|
||||
|
|
@ -454,7 +450,6 @@ static int receive_fd(int pid, struct fdinfo_list_entry *fle)
|
|||
struct fdinfo_list_entry *flem;
|
||||
|
||||
flem = file_master(fle->desc);
|
||||
|
||||
if (flem->pid == pid)
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue