7f4c2a
From 42c12a784d3acdb135eaf69d0589f9b6ddc277f3 Mon Sep 17 00:00:00 2001
7f4c2a
From: Ashish Pandey <aspandey@redhat.com>
7f4c2a
Date: Tue, 8 Sep 2015 12:27:50 +0530
7f4c2a
Subject: [PATCH 323/330] features/snap : cleanup the root loc in statfs
7f4c2a
7f4c2a
Problem : In svc_statfs function, wipe_loc is getting called on loc
7f4c2a
          passed by nfs. This loc is being used by svc_stat which
7f4c2a
          throws erro if loc->inode is NULL.
7f4c2a
7f4c2a
Solution : wipe_loc should be called on local root_loc.
7f4c2a
7f4c2a
Patch for upstream -
7f4c2a
http://review.gluster.org/#/c/12123/
7f4c2a
7f4c2a
Patch for downstream -
7f4c2a
http://review.gluster.org/#/c/12147/
7f4c2a
7f4c2a
Change-Id: I9cc5ee3b1bd9f352f2362a6d997b7b09051c0f68
7f4c2a
BUG: 1257509
7f4c2a
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
7f4c2a
Reviewed-on: https://code.engineering.redhat.com/gerrit/57439
7f4c2a
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
7f4c2a
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
7f4c2a
---
7f4c2a
 tests/bugs/snapshot/bug-1260848.t                  |   25 ++++++++++++++++++++
7f4c2a
 .../features/snapview-client/src/snapview-client.c |    2 +-
7f4c2a
 2 files changed, 26 insertions(+), 1 deletions(-)
7f4c2a
 create mode 100644 tests/bugs/snapshot/bug-1260848.t
7f4c2a
7f4c2a
diff --git a/tests/bugs/snapshot/bug-1260848.t b/tests/bugs/snapshot/bug-1260848.t
7f4c2a
new file mode 100644
7f4c2a
index 0000000..9963b29
7f4c2a
--- /dev/null
7f4c2a
+++ b/tests/bugs/snapshot/bug-1260848.t
7f4c2a
@@ -0,0 +1,25 @@
7f4c2a
+#!/bin/bash
7f4c2a
+
7f4c2a
+. $(dirname $0)/../../include.rc
7f4c2a
+. $(dirname $0)/../../nfs.rc
7f4c2a
+. $(dirname $0)/../../volume.rc
7f4c2a
+
7f4c2a
+cleanup;
7f4c2a
+
7f4c2a
+## Start and create a volume
7f4c2a
+TEST glusterd
7f4c2a
+TEST pidof glusterd
7f4c2a
+
7f4c2a
+TEST $CLI volume create $V0 disperse 6 redundancy 2 $H0:$B0/${V0}{0..5}
7f4c2a
+TEST $CLI volume set $V0 uss on
7f4c2a
+TEST $CLI volume start $V0
7f4c2a
+
7f4c2a
+## Wait for volume to register with rpc.mountd
7f4c2a
+EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available;
7f4c2a
+
7f4c2a
+## Mount NFS
7f4c2a
+TEST mount_nfs $H0:/$V0 $N0 nolock;
7f4c2a
+
7f4c2a
+TEST df -h $N0
7f4c2a
+
7f4c2a
+cleanup;
7f4c2a
diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c
7f4c2a
index b3f1a92..e784ff6 100644
7f4c2a
--- a/xlators/features/snapview-client/src/snapview-client.c
7f4c2a
+++ b/xlators/features/snapview-client/src/snapview-client.c
7f4c2a
@@ -546,7 +546,7 @@ svc_statfs (call_frame_t *frame, xlator_t *this, loc_t *loc,
7f4c2a
 
7f4c2a
         STACK_WIND_TAIL (frame, subvolume, subvolume->fops->statfs,
7f4c2a
                          temp_loc, xdata);
7f4c2a
-        if (temp_loc)
7f4c2a
+        if (temp_loc == &root_loc)
7f4c2a
                 loc_wipe (temp_loc);
7f4c2a
 
7f4c2a
         wind = _gf_true;
7f4c2a
-- 
7f4c2a
1.7.1
7f4c2a