files: print an error if fdinfo can't be opened

Submitted by Andrei Vagin on Sept. 27, 2017, 10:57 p.m.

Details

Message ID 20170927225724.31443-1-avagin@openvz.org
State Accepted
Series "files: print an error if fdinfo can't be opened"
Commit 0fcb724ca2d5aface4a87f2b68e6007b717820a1
Headers show

Commit Message

Andrei Vagin Sept. 27, 2017, 10:57 p.m.
Without this message, we don't know which fdinfo can't be opened.

https://github.com/xemul/criu/issues/390
Signed-off-by: Andrei Vagin <avagin@openvz.org>
---
 criu/files.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/criu/files.c b/criu/files.c
index e084316..28b21dd 100644
--- a/criu/files.c
+++ b/criu/files.c
@@ -1103,8 +1103,11 @@  static int open_fdinfos(struct pstree_item *me)
 			st = fle->stage;
 			BUG_ON(st == FLE_RESTORED);
 			ret = open_fd(fle);
-			if (ret == -1)
+			if (ret == -1) {
+				pr_err("Unable to open fd=%d id=%#x\n",
+					fle->fe->fd, fle->fe->id);
 				goto splice;
+			}
 			if (st != fle->stage || ret == 0)
 				progress = true;
 			if (ret == 0) {

Comments

Andrey Vagin Sept. 30, 2017, 12:52 a.m.
Applied
On Wed, Sep 27, 2017 at 03:57:24PM -0700, Andrei Vagin wrote:
> Without this message, we don't know which fdinfo can't be opened.
> 
> https://github.com/xemul/criu/issues/390
> Signed-off-by: Andrei Vagin <avagin@openvz.org>
> ---
>  criu/files.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/criu/files.c b/criu/files.c
> index e084316..28b21dd 100644
> --- a/criu/files.c
> +++ b/criu/files.c
> @@ -1103,8 +1103,11 @@ static int open_fdinfos(struct pstree_item *me)
>  			st = fle->stage;
>  			BUG_ON(st == FLE_RESTORED);
>  			ret = open_fd(fle);
> -			if (ret == -1)
> +			if (ret == -1) {
> +				pr_err("Unable to open fd=%d id=%#x\n",
> +					fle->fe->fd, fle->fe->id);
>  				goto splice;
> +			}
>  			if (st != fle->stage || ret == 0)
>  				progress = true;
>  			if (ret == 0) {
> -- 
> 2.9.4
>