Gustavo Frederico Temple Pedrosa has uploaded a new change for review.

Change subject: core: [Fix] NPE in GlusterSyncJob
......................................................................

core: [Fix] NPE in GlusterSyncJob

Add validation for corrupt brick(s).

Change-Id: I0c0209683ab1fc4c837c23d4223278582fc0f920
Signed-off-by: Gustavo Pedrosa <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSyncJob.java
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/10/24110/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSyncJob.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSyncJob.java
index fc14cc5..6bcf4da 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSyncJob.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSyncJob.java
@@ -453,7 +453,12 @@
         }
 
         for (GlusterBrickEntity brick : volume.getBricks()) {
-            if (brick.getServerId() == null) {
+            if (brick == null) {
+                log.warnFormat("Volume {0} contains a apparently corrupt 
brick(s). " +
+                        "Hence will not add it to engine at this point.",
+                        volume.getName());
+                return;
+            } else if (brick.getServerId() == null) {
                 log.warnFormat("Volume {0} contains brick(s) from unknown 
hosts. " +
                         "Hence will not add it to engine at this point.",
                         volume.getName());


-- 
To view, visit http://gerrit.ovirt.org/24110
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c0209683ab1fc4c837c23d4223278582fc0f920
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Gustavo Frederico Temple Pedrosa <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to