|
|
7a3408 |
From 642c0565683b08aa183c835e998e1b81398dfbd0 Mon Sep 17 00:00:00 2001
|
|
|
7a3408 |
Message-Id: <642c0565683b08aa183c835e998e1b81398dfbd0@dist-git>
|
|
|
7a3408 |
From: John Ferlan <jferlan@redhat.com>
|
|
|
7a3408 |
Date: Wed, 2 Sep 2015 09:55:12 -0400
|
|
|
7a3408 |
Subject: [PATCH] virfile: Add error for root squash change mode failure
|
|
|
7a3408 |
|
|
|
7a3408 |
https://bugzilla.redhat.com/show_bug.cgi?id=1253609
|
|
|
7a3408 |
|
|
|
7a3408 |
This will only be seen when debugging, but in order to help determine
|
|
|
7a3408 |
whether a virFileOpenForceOwnerMode failed during an NFS root-squash
|
|
|
7a3408 |
volume/file creation, add an error message from the child.
|
|
|
7a3408 |
|
|
|
7a3408 |
(cherry picked from commit 1fafc1bc1cd5c18f36089ec697da08f72270b35c)
|
|
|
7a3408 |
Signed-off-by: John Ferlan <jferlan@redhat.com>
|
|
|
7a3408 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
7a3408 |
---
|
|
|
7a3408 |
src/util/virfile.c | 7 ++++++-
|
|
|
7a3408 |
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
|
7a3408 |
|
|
|
7a3408 |
diff --git a/src/util/virfile.c b/src/util/virfile.c
|
|
|
7a3408 |
index 61f6e4d..e657913 100644
|
|
|
7a3408 |
--- a/src/util/virfile.c
|
|
|
7a3408 |
+++ b/src/util/virfile.c
|
|
|
7a3408 |
@@ -2087,8 +2087,13 @@ virFileOpenForked(const char *path, int openflags, mode_t mode,
|
|
|
7a3408 |
|
|
|
7a3408 |
/* File is successfully open. Set permissions if requested. */
|
|
|
7a3408 |
ret = virFileOpenForceOwnerMode(path, fd, mode, uid, gid, flags);
|
|
|
7a3408 |
- if (ret < 0)
|
|
|
7a3408 |
+ if (ret < 0) {
|
|
|
7a3408 |
+ ret = -errno;
|
|
|
7a3408 |
+ virReportSystemError(errno,
|
|
|
7a3408 |
+ _("child process failed to force owner mode file '%s'"),
|
|
|
7a3408 |
+ path);
|
|
|
7a3408 |
goto childerror;
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
|
|
|
7a3408 |
do {
|
|
|
7a3408 |
ret = sendfd(pair[1], fd);
|
|
|
7a3408 |
--
|
|
|
7a3408 |
2.5.1
|
|
|
7a3408 |
|