diff options
| author | Kaushal M <kaushal@redhat.com> | 2013-04-26 11:39:15 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vbellur@redhat.com> | 2013-04-26 00:35:00 -0700 | 
| commit | 45a9d1e70e0d3e0ab504643a3cd1bf3f0a3a43fd (patch) | |
| tree | 818cf0835053bff1f795ac4a0190c02358400328 | |
| parent | 0ab16bb29a2e242714a76a3bad31921142c7dd35 (diff) | |
distribute: Fix fds being leaked during rebalance
This patch is a backport of 2 patches from master branch which fixes the
leak of fds during a rebalance process.
The patches are,
* libglusterfs/syncop: do not hold ref on the fd in cbk
  (e979c0de9dde14fe18d0ad7298c6da9cc878bbab)
* cluster/distribute: Remove suprious fd_unref call
  (5d29e598665456b2b7250fdca14de7409098877a)
Change-Id: Icea1d0b32cb3670f7decc24261996bca3fe816dc
BUG: 928631
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/4888
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
| -rw-r--r-- | libglusterfs/src/syncop.c | 6 | ||||
| -rw-r--r-- | xlators/cluster/dht/src/dht-helper.c | 14 | 
2 files changed, 6 insertions, 14 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index 4be00219827..0c462064392 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -931,9 +931,6 @@ syncop_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; -        if (op_ret != -1) -                fd_ref (fd); -          __wake (args);          return 0; @@ -1079,9 +1076,6 @@ syncop_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          args->op_ret   = op_ret;          args->op_errno = op_errno; -        if (op_ret != -1) -                fd_ref (fd); -          __wake (args);          return 0; diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index d866a2cd17f..18a0d9de21e 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -711,6 +711,9 @@ dht_migration_complete_check_task (void *data)          src_node = local->cached_subvol; +        if (!local->loc.inode && !local->fd) +                goto out; +          /* getxattr on cached_subvol for 'linkto' value */          if (!local->loc.inode)                  ret = syncop_fgetxattr (src_node, local->fd, &dict, @@ -803,9 +806,6 @@ dht_migration_complete_check_task (void *data)          local->cached_subvol = dst_node;          ret = 0; -        if (!local->fd) -                goto out; -          /* once we detect the migration complete, the fd-ctx is no more             required.. delete the ctx, and do one extra 'fd_unref' for open fd */          ret = fd_ctx_del (local->fd, this, NULL); @@ -838,8 +838,6 @@ dht_migration_complete_check_task (void *data)                  goto out;          } -        /* need this unref for the fd on src_node */ -        fd_unref (local->fd);          ret = 0;  out: @@ -890,6 +888,9 @@ dht_rebalance_inprogress_task (void *data)          src_node = local->cached_subvol; +        if (!local->loc.inode && !local->fd) +                goto out; +          /* getxattr on cached_subvol for 'linkto' value */          if (local->loc.inode)                  ret = syncop_getxattr (src_node, &local->loc, &dict, @@ -938,9 +939,6 @@ dht_rebalance_inprogress_task (void *data)          ret = 0; -        if (!local->fd) -                goto out; -          if (local->loc.inode) {                  ret = syncop_open (dst_node, &local->loc,                                     local->fd->flags, local->fd);  | 
