cb8e9e
From 9e6cd8779bd8ceab1327856b85fedc80412c5252 Mon Sep 17 00:00:00 2001
cb8e9e
From: Mohammed Rafi KC <rkavunga@redhat.com>
cb8e9e
Date: Mon, 11 May 2015 12:36:33 +0530
cb8e9e
Subject: [PATCH 266/279] uss: Take ref on root inode
cb8e9e
cb8e9e
If we recieve a statfs call on snap directory, we will redirect
cb8e9e
the call into the root, by creating a new root loc. So it is better to
cb8e9e
take a ref on the root inode
cb8e9e
(http://review.gluster.org/#/c/10358/5/xlators/features/
cb8e9e
snapview-client/src/snapview-client.c)
cb8e9e
cb8e9e
Back port of :
cb8e9e
>Change-Id: I5649addac442d391b2550346b115dec58fed5b86
cb8e9e
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
cb8e9e
>Reviewed-on: http://review.gluster.org/10750
cb8e9e
>Tested-by: NetBSD Build System <jenkins@build.gluster.org>
cb8e9e
>Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
cb8e9e
cb8e9e
Change-Id: Idd575a5313bcbc3d7bfdd954c7bfecce371f3add
cb8e9e
BUG: 1245919
cb8e9e
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
cb8e9e
Reviewed-on: http://review.gluster.org/11094
cb8e9e
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
cb8e9e
Tested-by: Gluster Build System <jenkins@build.gluster.com>
cb8e9e
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
cb8e9e
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
cb8e9e
Reviewed-on: https://code.engineering.redhat.com/gerrit/55133
cb8e9e
Tested-by: Rajesh Joseph <rjoseph@redhat.com>
cb8e9e
---
cb8e9e
 .../features/snapview-client/src/snapview-client.c |    5 +++--
cb8e9e
 1 files changed, 3 insertions(+), 2 deletions(-)
cb8e9e
cb8e9e
diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c
cb8e9e
index 2f304aa..81e3b20 100644
cb8e9e
--- a/xlators/features/snapview-client/src/snapview-client.c
cb8e9e
+++ b/xlators/features/snapview-client/src/snapview-client.c
cb8e9e
@@ -539,14 +539,15 @@ svc_statfs (call_frame_t *frame, xlator_t *this, loc_t *loc,
cb8e9e
                         root_loc.path = "/";
cb8e9e
                         gf_uuid_clear(root_loc.gfid);
cb8e9e
                         root_loc.gfid[15] = 1;
cb8e9e
-                        root_loc.inode = loc->inode->table->root;
cb8e9e
-                        root_loc.inode->ia_type = IA_IFDIR;
cb8e9e
+                        root_loc.inode = inode_ref (loc->inode->table->root);
cb8e9e
                         temp_loc = &root_loc;
cb8e9e
                 }
cb8e9e
         }
cb8e9e
 
cb8e9e
         STACK_WIND_TAIL (frame, subvolume, subvolume->fops->statfs,
cb8e9e
                          temp_loc, xdata);
cb8e9e
+        if (temp_loc)
cb8e9e
+                loc_wipe (temp_loc);
cb8e9e
 
cb8e9e
         wind = _gf_true;
cb8e9e
 out:
cb8e9e
-- 
cb8e9e
1.7.1
cb8e9e