From e0daaed286894a4793f1427e938615022356b13f Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Sat, 15 Dec 2012 03:45:18 +0100 Subject: NULL reference fix in gfid log On callbacks, make sure loc.inode is not NULL before priting its gfid. BUG: 815227 Change-Id: Iab22b65217b5711ad8a92c83e335d9cb1a23841c Signed-off-by: Emmanuel Dreyfus Reviewed-on: http://review.gluster.org/4313 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/mount/fuse/src/fuse-bridge.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'xlators/mount') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 974969eb1..a6d022103 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -632,7 +632,7 @@ fuse_attr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, fuse_log_eh (this, "op_ret: %d, op_errno: %d, %"PRIu64": %s() %s => " "gfid: %s", op_ret, op_errno, frame->root->unique, gf_fop_list[frame->root->op], state->loc.path, - uuid_utoa (state->loc.inode->gfid)); + state->loc.inode ? uuid_utoa (state->loc.inode->gfid) : ""); if (op_ret == 0) { gf_log ("glusterfs-fuse", GF_LOG_TRACE, "%"PRIu64": %s() %s => %"PRId64, frame->root->unique, @@ -916,7 +916,7 @@ fuse_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, fuse_log_eh(this, "op_ret: %d, op_errno: %d, %"PRIu64", %s() %s => " "gfid: %s", op_ret, op_errno, frame->root->unique, gf_fop_list[frame->root->op], state->loc.path, - uuid_utoa (state->loc.inode->gfid)); + state->loc.inode ? uuid_utoa (state->loc.inode->gfid) : ""); if (op_ret == 0) { gf_log ("glusterfs-fuse", GF_LOG_TRACE, @@ -1175,7 +1175,7 @@ fuse_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, fuse_log_eh (this, "op_ret: %d, op_errno: %d, %"PRIu64": %s() %s => " "gfid: %s", op_ret, op_errno, frame->root->unique, gf_fop_list[frame->root->op], state->loc.path, - uuid_utoa (state->loc.inode->gfid)); + state->loc.inode ? uuid_utoa (state->loc.inode->gfid) : ""); if (op_ret == 0) { inode_unlink (state->loc.inode, state->loc.parent, @@ -1588,10 +1588,10 @@ fuse_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, "path: %s parent: %s ==> path: %s parent: %s" "gfid: %s", op_ret, op_errno, frame->root->unique, gf_fop_list[frame->root->op], state->loc.path, - uuid_utoa (state->loc.parent->gfid), + state->loc.parent?uuid_utoa (state->loc.parent->gfid):"", state->loc2.path, - uuid_utoa (state->loc2.parent->gfid), - uuid_utoa (state->loc.inode->gfid)); + state->loc2.parent?uuid_utoa (state->loc2.parent->gfid):"", + state->loc.inode?uuid_utoa (state->loc.inode->gfid):""); if (op_ret == 0) { gf_log ("glusterfs-fuse", GF_LOG_TRACE, -- cgit