17b94a
From 72168245761592a2cd0ebec05dd9bd9bc00745ca Mon Sep 17 00:00:00 2001
17b94a
From: Amar Tumballi <amarts@redhat.com>
17b94a
Date: Wed, 13 Mar 2019 08:51:31 +0530
17b94a
Subject: [PATCH 330/335] mount.glusterfs: change the error message
17b94a
17b94a
In scenarios where a mount fails before creating log file, doesn't
17b94a
make sense to give message to 'check log file'. See below:
17b94a
17b94a
```
17b94a
ERROR: failed to create logfile "/var/log/glusterfs/mnt.log" (No space left on device)
17b94a
ERROR: failed to open logfile /var/log/glusterfs/mnt.log
17b94a
Mount failed. Please check the log file for more details.
17b94a
```
17b94a
17b94a
>upstream patch: https://review.gluster.org/#/c/glusterfs/+/22346/
17b94a
>Fixes: bz#1688068
17b94a
>Change-Id: I1d837caa4f9bc9f1a37780783e95007e01ae4e3f
17b94a
>Signed-off-by: Amar Tumballi <amarts@redhat.com>
17b94a
17b94a
BUG: 1685406
17b94a
Change-Id: I1d837caa4f9bc9f1a37780783e95007e01ae4e3f
17b94a
Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>
17b94a
Reviewed-on: https://code.engineering.redhat.com/gerrit/185828
17b94a
Tested-by: RHGS Build Bot <nigelb@redhat.com>
17b94a
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
17b94a
---
17b94a
 xlators/mount/fuse/utils/mount.glusterfs.in | 9 +++++++--
17b94a
 1 file changed, 7 insertions(+), 2 deletions(-)
17b94a
17b94a
diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in
17b94a
index 3f5d76d..cbde42d 100755
17b94a
--- a/xlators/mount/fuse/utils/mount.glusterfs.in
17b94a
+++ b/xlators/mount/fuse/utils/mount.glusterfs.in
17b94a
@@ -361,7 +361,10 @@ start_glusterfs ()
17b94a
     cmd_line=$(echo "$cmd_line $mount_point");
17b94a
     $cmd_line;
17b94a
     if [ $? -ne 0 ]; then
17b94a
-        warn "Mount failed. Please check the log file for more details."
17b94a
+        # If this is true, then glusterfs process returned error without
17b94a
+        # getting daemonized. We have made sure the logs are posted to
17b94a
+        # 'stderr', so no need to point them to logfile.
17b94a
+        warn "Mounting glusterfs on $mount_point failed."
17b94a
         exit 1;
17b94a
     fi
17b94a
 
17b94a
@@ -369,7 +372,9 @@ start_glusterfs ()
17b94a
     inode=$( ${getinode} $mount_point 2>/dev/null);
17b94a
     # this is required if the stat returns error
17b94a
     if [ $? -ne 0 ]; then
17b94a
-        warn "Mount failed. Please check the log file for more details."
17b94a
+        # At this time, glusterfs got daemonized, and then later exited.
17b94a
+        # These failures are only logged in log file.
17b94a
+        warn "Mount failed. Check the log file ${log_file} for more details."
17b94a
         umount $mount_point > /dev/null 2>&1;
17b94a
         exit 1;
17b94a
     fi
17b94a
-- 
17b94a
1.8.3.1
17b94a