From 73c6b2f21a67bed186a279adacb4eb28eafcd853 Mon Sep 17 00:00:00 2001 From: Pavan Sondur Date: Sat, 2 Oct 2010 06:14:33 +0000 Subject: protocol/client: Fix dumping of locks in client. Signed-off-by: Pavan Vilas Sondur Signed-off-by: Vijay Bellur BUG: 865 (Add locks recovery support in GlusterFS) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=865 --- xlators/protocol/client/src/client-lk.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'xlators/protocol/client/src/client-lk.c') diff --git a/xlators/protocol/client/src/client-lk.c b/xlators/protocol/client/src/client-lk.c index c5696500c..b6944ba40 100644 --- a/xlators/protocol/client/src/client-lk.c +++ b/xlators/protocol/client/src/client-lk.c @@ -914,20 +914,16 @@ client_dump_locks (char *name, inode_t *inode, dict_t *dict) { int ret = 0; + dict_t *new_dict = NULL; char dict_string[256]; + GF_ASSERT (dict); + new_dict = dict; + ret = dump_client_locks (inode); snprintf (dict_string, 256, "%d locks dumped in log file", ret); - dict = dict_new (); - if (!dict) { - gf_log (THIS->name, GF_LOG_DEBUG, - "Out of memory"); - ret = -1; - goto out; - } - - ret = dict_set_str (dict, "trusted.glusterfs.clientlk-dump", dict_string); + ret = dict_set_dynstr(new_dict, CLIENT_DUMP_LOCKS, dict_string); if (ret) { gf_log (THIS->name, GF_LOG_DEBUG, "Could not set dict with %s", CLIENT_DUMP_LOCKS); @@ -935,6 +931,7 @@ client_dump_locks (char *name, inode_t *inode, } out: + return ret; } -- cgit