[PATCH 0/2] Fix tar-in, tgz-in commands (RHBZ#580246)
Two-part patch to fix RHBZ#580246. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
On 08/04/10 08:58, Richard W.M. Jones wrote:
From 07f4b20ae959069fca41756b0dc103ec5fa99754 Mon Sep 17 00:00:00 2001 From: Richard Jones <rjones@redhat.com> Date: Thu, 8 Apr 2010 08:48:38 +0100 Subject: [PATCH 1/2] Fix tar-in command hangs when running out of disk space (RHBZ#580246).
The problem was this sequence of events:
(1) File transfer goes through OK.
(2) pclose returns failure (because 'tar' subprocess failed)
(3) We try to cancel the transfer by calling cancel_receive.
Step (3) fails because the transfer (as far as the library is concerned) has succeeded, so causing a hang.
The more fundamental reason why we see steps (1) and (2) is that 'tar' does NOT fail immediately if there is a write error. Instead it continues reading and discarding the input until the end of the input before giving "Error exit delayed from previous errors". IMHO this is a bug with tar, since an ENOSPC write error should be fatal for tar.
ACK. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
On 08/04/10 08:58, Richard W.M. Jones wrote:
From 514fa1fe48c38213cebc71b787469ed36dcf367a Mon Sep 17 00:00:00 2001 From: Richard Jones <rjones@redhat.com> Date: Wed, 7 Apr 2010 21:04:01 +0100 Subject: [PATCH 2/2] Code cleanups related to RHBZ#580246.
This includes various code cleanups:
(a) A regression test for RHBZ#580246.
(b) Use write instead of fwrite to write out the tar file. This is just because the error handling of write seems to be better specified and easier to use.
(c) Use size_t instead of int for length.
(d) Clearer debug messages when in verbose mode.
ACK. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
participants (2)
-
Matthew Booth -
Richard W.M. Jones