summaryrefslogtreecommitdiffstats
path: root/xlators/mount
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2012-12-15 03:45:18 +0100
committerVijay Bellur <vbellur@redhat.com>2012-12-15 09:23:29 -0800
commite0daaed286894a4793f1427e938615022356b13f (patch)
treed2e8bd122d9df4aa1c109a839c784fef8591afd3 /xlators/mount
parent1b681f27e04ae3b74a461ef2601ac8c48ad6b1c3 (diff)
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 <manu@netbsd.org> Reviewed-on: http://review.gluster.org/4313 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mount')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 974969eb110..a6d02210368 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,