From 1bd16d981c8b82aa2b6e1c45b3300647dc623eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 9 Nov 2013 19:04:24 +0100 Subject: [PATCH] tar2qfile: ignore EDQUOT error from dom0 dom0 will use quota enforcement to extract only backup header, so this is normal situation in this tool. --- qubes-rpc/qfile-utils.c | 8 ++++++++ qubes-rpc/tar2qfile.c | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/qubes-rpc/qfile-utils.c b/qubes-rpc/qfile-utils.c index 6e62882..ac804f8 100644 --- a/qubes-rpc/qfile-utils.c +++ b/qubes-rpc/qfile-utils.c @@ -3,6 +3,7 @@ unsigned long crc32_sum; int ignore_symlinks = 0; +int ignore_quota_error = 0; void notify_progress(int size, int flag) { @@ -106,6 +107,13 @@ void wait_for_result() case EINVAL: gui_fatal("File copy: Corrupted data from packer%s%s", last_filename_prefix, last_filename); break; + case EDQUOT: + if (ignore_quota_error) { + /* skip also CRC check as sender and receiver might be + * desynchronized in this case */ + return; + } + /* fall though */ default: gui_fatal("File copy: %s%s%s", strerror(hdr.error_code), last_filename_prefix, last_filename); diff --git a/qubes-rpc/tar2qfile.c b/qubes-rpc/tar2qfile.c index d41f2e8..408150a 100644 --- a/qubes-rpc/tar2qfile.c +++ b/qubes-rpc/tar2qfile.c @@ -166,6 +166,7 @@ static unsigned long tar_chksm (char *, int); char *gnu_hack_string; /* GNU ././@LongLink hackery */ char untrusted_namebuf[MAX_PATH_LENGTH]; +extern int ignore_quota_error; /* @@ -820,6 +821,9 @@ int main(int argc, char **argv) //set_size_limit(1500000000, 2048); crc32_sum = 0; + /* when extracting backup header, dom0 will terminate the transfer with + * EDQUOT just after getting qubes.xml */ + ignore_quota_error = 1; for (i = 1; i < argc; i++) { set_nonblock(0); if (strcmp(argv[i], "--ignore-symlinks")==0) {