From 1bfa7d3894a5217a425ac01ab5f952bab56afa2d Mon Sep 17 00:00:00 2001 From: Ashish Pandey Date: Mon, 18 Jan 2016 15:57:41 +0530 Subject: Fuse: Add a check for NULL in fuse_itable_dump Problem: Immediately after starting a disperse volume (2+1) kill one brick and just after that try to mount it through fuse. This lead to crash. Our test scripts use process statedumps to determine various things like whether they are up, connected to bricks etc. It takes some time for an active_subvol to be be associated with fuse even after mount process is daemonized. This time is normally a function of completion of handshake with bricks. So, if we try to take statedump in this time window, fuse wouldn't have an active_subvol associated with it leading to this crash. This happened while executing ec-notify.t, which contains above steps. Solution: Check priv and priv->active_subvol for NULL before inode_table_dump. If priv->active_subvol is null its perfectly fine to skip dumping of inode table as inode table is associated with an active_subvol. A Null active_subvol indicates initialization in progress and fuse wouldn't even have started reading requests from /dev/fuse and hence there wouldn't be any inodes or file system activity. Change-Id: I323a154789edf8182dbd1ac5ec7ae07bf59b2060 BUG: 1305428 Signed-off-by: Ashish Pandey Reviewed-on: http://review.gluster.org/13253 Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Raghavendra G Signed-off-by: Ashish Pandey Reviewed-on: http://review.gluster.org/13396 Reviewed-by: Xavier Hernandez --- xlators/mount/fuse/src/fuse-bridge.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'xlators/mount') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 87db40fd8c9..895f3b0a1df 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -4995,12 +4995,18 @@ fuse_thread_proc (void *data) int32_t fuse_itable_dump (xlator_t *this) { + fuse_private_t *priv = NULL; + if (!this) return -1; - gf_proc_dump_add_section("xlator.mount.fuse.itable"); - inode_table_dump(this->itable, "xlator.mount.fuse.itable"); + priv = this->private; + if (priv && priv->active_subvol) { + gf_proc_dump_add_section("xlator.mount.fuse.itable"); + inode_table_dump(priv->active_subvol->itable, + "xlator.mount.fuse.itable"); + } return 0; } -- cgit