Commit a66217a2 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

image: open lazy images in img_raw_fd()

Lazy images are opened on a first attempt of using.

00:01:18.534 Test: zdtm/live/static/pipe00, Result: FAIL
00:01:18.537 ==================================== ERROR ====================================
00:01:18.538 Test: zdtm/live/static/pipe00, Namespace: 1
00:01:18.538 Dump log   : /var/lib/jenkins/jobs/CRIU/workspace/test/dump/ns/static/pipe00/13536/1/dump.log
00:01:18.540 --------------------------------- grep Error ---------------------------------
00:01:18.543 (00.026666) Error (include/image.h:153): BUG at include/image.h:153
00:01:18.543 (00.050663) Error (namespaces.c:801): Namespaces dumping finished with error 134
00:01:18.543 (00.050918) Error (cr-dump.c:1979): Dumping FAILED.
00:01:18.545 ------------------------------------- END -------------------------------------
00:01:18.548 ================================= ERROR OVER =================================

Reported-by: Mr Jenkins
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 8ce37e67
...@@ -148,8 +148,13 @@ static inline bool lazy_image(struct cr_img *img) ...@@ -148,8 +148,13 @@ static inline bool lazy_image(struct cr_img *img)
return img->_x.fd == LAZY_IMG_FD; return img->_x.fd == LAZY_IMG_FD;
} }
extern int open_image_lazy(struct cr_img *img);
static inline int img_raw_fd(struct cr_img *img) static inline int img_raw_fd(struct cr_img *img)
{ {
if (lazy_image(img) && open_image_lazy(img))
return -1;
BUG_ON(bfd_buffered(&img->_x)); BUG_ON(bfd_buffered(&img->_x));
return img->_x.fd; return img->_x.fd;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment