summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnand Avati <avati@dev.gluster.com>2009-08-06 21:51:33 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-08-07 01:24:33 -0700
commit2be295d30acd61a919796227fef71f2757f88440 (patch)
treeb567fefdc0058166af9bb31567925c4a59599ec2
parentf6ea2b29707d700596f73f3de8b7e09e824327d1 (diff)
protocol/client: fixed registration of saved_fds
In client_open_cbk, client_opendir_cbk the list_add_tail macros were invoked with wrong ordered arguments, causing the existing registered fd list to get unlinked from the saved_fds list. The effects of this is far fetched - when transport disconnects, open fds are no more marked bad as they are not reachable from the saved_fds list. After reconnection, resumed access on this fd causes reference to invalid fds on the server. It could appear in the form of 'unresolved fd' error, readdir happening on a file fd, files reading from other files, etc. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 192 (sefault in posix-readdir) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=192 BUG: 126 (Immediate segfault when used for rootfs) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=126 BUG: 173 ([ glusterfs 2.0.6rc1 ] - "server SEG fault") URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=173 BUG: 194 (Apache+Booster results in inconsistent download size using wget) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=194
-rw-r--r--xlators/protocol/client/src/client-protocol.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c
index 80995f25ba8..505ded7823c 100644
--- a/xlators/protocol/client/src/client-protocol.c
+++ b/xlators/protocol/client/src/client-protocol.c
@@ -3920,7 +3920,7 @@ client_open_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
pthread_mutex_lock (&conf->mutex);
{
- list_add_tail (&conf->saved_fds, &fdctx->sfd_pos);
+ list_add_tail (&fdctx->sfd_pos, &conf->saved_fds);
}
pthread_mutex_unlock (&conf->mutex);
}
@@ -4628,7 +4628,7 @@ client_opendir_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen,
pthread_mutex_lock (&conf->mutex);
{
- list_add_tail (&conf->saved_fds, &fdctx->sfd_pos);
+ list_add_tail (&fdctx->sfd_pos, &conf->saved_fds);
}
pthread_mutex_unlock (&conf->mutex);
}