From f1c20897cc18fb3b257880e7a098c05eae28fd0f Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Mon, 11 May 2015 12:36:33 +0530 Subject: 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) Change-Id: I5649addac442d391b2550346b115dec58fed5b86 Signed-off-by: Mohammed Rafi KC Reviewed-on: http://review.gluster.org/10750 Tested-by: NetBSD Build System Reviewed-by: Raghavendra Bhat --- xlators/features/snapview-client/src/snapview-client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xlators/features/snapview-client') diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c index 5f325af3b37..c575975d8dc 100644 --- a/xlators/features/snapview-client/src/snapview-client.c +++ b/xlators/features/snapview-client/src/snapview-client.c @@ -534,14 +534,15 @@ svc_statfs (call_frame_t *frame, xlator_t *this, loc_t *loc, root_loc.path = "/"; 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: -- cgit