[PATCH 3/7] virfile: Need to check for ENOTCONN from recvfd failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A gnulib change (commit id 'beae0bdc') causes ENOTCONN to be returned
from recvfd which causes us to fall into the throwaway waitpid() call
and return ENOTCONN to the caller, this then gets displayed during
a 'virsh save' when using a root squashed NFS environment that's trying
to save the file as something other than root:root.

This patch will add the additional check for ENOTCONN to force the code
into the waitpid loop looking for the actual status from the _exit()'d
child fork.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/util/virfile.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/util/virfile.c b/src/util/virfile.c
index 5f56005..4024f3d 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -2125,7 +2125,8 @@ virFileOpenForked(const char *path, int openflags, mode_t mode,
     } while (fd < 0 && errno == EINTR);
     VIR_FORCE_CLOSE(pair[0]); /* NB: this preserves errno */
 
-    if (fd < 0 && errno != EACCES) {
+    /* gnulib will return ENOTCONN in certain instances */
+    if (fd < 0 && !(errno == EACCES || errno == ENOTCONN)) {
         ret = -errno;
         while (waitpid(pid, NULL, 0) == -1 && errno == EINTR);
         return ret;
-- 
2.1.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]