diff options
author | Raghavendra Bhat <raghavendrabhat@gluster.com> | 2012-05-02 16:29:49 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-05-03 15:58:48 -0700 |
commit | d88237faa6982c9f0beca65262a220becaacb096 (patch) | |
tree | a1ab84a677eccad30d548f835033955477f6ece5 /xlators/cluster/afr | |
parent | 7509afb03da6fe9a0f07e902869f44d4ff545fa7 (diff) |
cluster/pump: Fixed fd leaks in pump directory traversal logic
Change-Id: Ie54c8c9b19be6824445ada6bbcd4983e90a7c5c4
BUG: 818593
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/3267
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/cluster/afr')
-rw-r--r-- | xlators/cluster/afr/src/pump.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/pump.c b/xlators/cluster/afr/src/pump.c index b2fd1f7385b..2d72e305098 100644 --- a/xlators/cluster/afr/src/pump.c +++ b/xlators/cluster/afr/src/pump.c @@ -437,7 +437,7 @@ gf_pump_traverse_directory (loc_t *loc) gf_pump_traverse_directory (&entry_loc); } } - } + } } gf_dirent_free (&entries); @@ -448,6 +448,10 @@ gf_pump_traverse_directory (loc_t *loc) } + ret = syncop_close (fd); + if (ret < 0) + gf_log (this->name, GF_LOG_DEBUG, "closing the fd failed"); + if (is_directory_empty && IS_ROOT_PATH (loc->path)) { pump_change_state (this, PUMP_STATE_RUNNING); gf_log (this->name, GF_LOG_INFO, "Empty source brick. " @@ -2258,6 +2262,17 @@ pump_release (xlator_t *this, } +static int32_t +pump_forget (xlator_t *this, inode_t *inode) +{ + afr_private_t *priv = NULL; + + priv = this->private; + if (priv->use_afr_in_pump) + afr_forget (this, inode); + + return 0; +} static int32_t pump_setattr (call_frame_t *frame, @@ -2622,6 +2637,7 @@ struct xlator_dumpops dumpops = { struct xlator_cbks cbks = { .release = pump_release, .releasedir = pump_releasedir, + .forget = pump_forget, }; struct volume_options options[] = { |