summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2015-05-11 12:36:33 +0530
committerRajesh Joseph <rjoseph@redhat.com>2015-08-13 23:44:45 -0700
commit39f2a499c69943dd0430e75276f55262de8c26b4 (patch)
tree1fdcd3628fd3e869532fc244d626f91804fda33d /xlators
parent0bbe6f776e68a77225ef64a19d5f043c052b570a (diff)
uss: Take ref on root inode
If we recieve a statfs call on snap directory, we will redirect the call into the root, by creating a new root loc. So it is better to take a ref on the root inode (http://review.gluster.org/#/c/10358/5/xlators/features/ snapview-client/src/snapview-client.c) Back port of : >Change-Id: I5649addac442d391b2550346b115dec58fed5b86 >Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> >Reviewed-on: http://review.gluster.org/10750 >Tested-by: NetBSD Build System <jenkins@build.gluster.org> >Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Change-Id: Idd575a5313bcbc3d7bfdd954c7bfecce371f3add BUG: 1228521 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/11094 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/snapview-client/src/snapview-client.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c
index 95b1b7c5a23..f1b3899194a 100644
--- a/xlators/features/snapview-client/src/snapview-client.c
+++ b/xlators/features/snapview-client/src/snapview-client.c
@@ -539,14 +539,15 @@ svc_statfs (call_frame_t *frame, xlator_t *this, loc_t *loc,
root_loc.path = gf_strdup("/");
gf_uuid_clear(root_loc.gfid);
root_loc.gfid[15] = 1;
- root_loc.inode = loc->inode->table->root;
- root_loc.inode->ia_type = IA_IFDIR;
+ root_loc.inode = inode_ref (loc->inode->table->root);
temp_loc = &root_loc;
}
}
STACK_WIND_TAIL (frame, subvolume, subvolume->fops->statfs,
temp_loc, xdata);
+ if (temp_loc)
+ loc_wipe (temp_loc);
wind = _gf_true;
out: