Blob Blame History Raw
From c1836d74994d75deda6666d991316d964a00978c Mon Sep 17 00:00:00 2001
From: Ashish Pandey <aspandey@redhat.com>
Date: Fri, 20 Jan 2017 15:57:22 +0530
Subject: [PATCH 275/275] cluster/disperse: Do not log fop failed for lockless
 fops

Problem: Operation failed messages are getting logged
based on the callbacks of lockless fop's. If a fop does
not take a lock, it is possible that it will get some
out of sync xattr, iatts. We can not depend on these
callback to psay that the fop has failed.

Solution: Print failed messages only for locked fops.
However, heal would still be triggered.

>Change-Id: I4427402c8c944c23f16073613caa03ea788bead3
>BUG: 1414287
>Signed-off-by: Ashish Pandey <aspandey@redhat.com>
>Reviewed-on: http://review.gluster.org/16435
>Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
>Smoke: Gluster Build System <jenkins@build.gluster.org>
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
>Signed-off-by: Ashish Pandey <aspandey@redhat.com>

Change-Id: I658209f2ba376b4f23385a7e6df541d0b1e23b0c
BUG: 1406322
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/95854
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
---
 xlators/cluster/ec/src/ec-common.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c
index c068cc3..3fbbe49 100644
--- a/xlators/cluster/ec/src/ec-common.c
+++ b/xlators/cluster/ec/src/ec-common.c
@@ -107,13 +107,15 @@ void ec_check_status(ec_fop_data_t * fop)
         }
     }
 
-    gf_msg (fop->xl->name, GF_LOG_WARNING, 0,
-            EC_MSG_OP_FAIL_ON_SUBVOLS,
-            "Operation failed on some "
-            "subvolumes (up=%lX, mask=%lX, "
-            "remaining=%lX, good=%lX, bad=%lX)",
-            ec->xl_up, fop->mask, fop->remaining, fop->good,
-            ec->xl_up & ~(fop->remaining | fop->good));
+    if (fop->lock_count > 0) {
+            gf_msg (fop->xl->name, GF_LOG_WARNING, 0,
+                    EC_MSG_OP_FAIL_ON_SUBVOLS,
+                    "Operation failed on some "
+                    "subvolumes (up=%lX, mask=%lX, "
+                    "remaining=%lX, good=%lX, bad=%lX)",
+                    ec->xl_up, fop->mask, fop->remaining, fop->good,
+                    ec->xl_up & ~(fop->remaining | fop->good));
+    }
 
     if (fop->use_fd)
     {
-- 
2.9.3