[Bugs] [Bug 1150188] New: Failure in gf_log_init reopening stderr

bugzilla at redhat.com bugzilla at redhat.com
Tue Oct 7 15:42:16 UTC 2014


https://bugzilla.redhat.com/show_bug.cgi?id=1150188

            Bug ID: 1150188
           Summary: Failure in gf_log_init reopening stderr
           Product: Red Hat Storage
           Version: 2.1
         Component: glusterfs
     Sub Component: core
          Severity: medium
          Assignee: vbellur at redhat.com
          Reporter: fharshav at redhat.com
        QA Contact: sdharane at redhat.com
                CC: aavati at redhat.com, bugs at gluster.org,
                    eharney at redhat.com, gluster-bugs at redhat.com,
                    greg.markey at sirca.org.au, jeckersb at redhat.com
        Depends On: 1088589
            Blocks: 1103413
             Group: redhat



+++ This bug was initially created as a clone of Bug #1088589 +++

The qemu gluster block driver attempts to set gluster logging to stderr as
such:

    ret = glfs_set_logging(glfs, "-", 4)

And then inside gf_log_init, "-" is matched, file is set to "/dev/stderr", and
the file is attempted to be reopened:

    fd = open (file, O_CREAT | O_RDONLY, S_IRUSR | S_IWUSR);

However this fails:

    ERROR: failed to create logfile "/dev/stderr" (Permission denied)

The reason is that libvirt has already redirected stderr into the logfile for
the VM and that file has restricted permissions:

[root at compute tmp]# ls -l /proc/29981/fd/2
l-wx------. 1 qemu qemu 64 Apr 16 15:11 /proc/29981/fd/2 ->
/var/log/libvirt/qemu/instance-0000000b.log
[root at compute tmp]# ls -l /var/log/libvirt/qemu/instance-0000000b.log
-rw-------. 1 root root 16768 Apr 16 15:11
/var/log/libvirt/qemu/instance-0000000b.log

So the process is unable to reopen the file, but there is already an open
descriptor that can be used.  In this case perhaps fall back to the old
behavior that was changed by this commit?:

https://forge.gluster.org/glusterfs-core/glusterfs/commit/00b159840added72099f61f45b38133e856d23bf

--- Additional comment from Anand Avati on 2014-04-29 16:59:19 EDT ---

REVIEW: http://review.gluster.org/7607 (logging: use duplicate stderr, instead
of re-opening) posted (#1) for review on master by Anand Avati
(avati at redhat.com)

--- Additional comment from Anand Avati on 2014-05-01 02:58:22 EDT ---

COMMIT: http://review.gluster.org/7607 committed in master by Vijay Bellur
(vbellur at redhat.com) 
------
commit 15ea78fffd63756fecf2f15887d3cad6a13d2a34
Author: Anand Avati <avati at redhat.com>
Date:   Tue Apr 29 13:54:53 2014 -0700

    logging: use duplicate stderr, instead of re-opening

    The special filename "-" is supposed to log to stderr. Instead of
    trying to explictly open "/dev/stderr" again (which may not be possible
    as permissions might have changed by then), dup the stderr and use
    the copy.

    It is not a good idea to use @stderr global variable directly, as
    ctx->log.logfile is fclose()d in glfs_fini() (was fixed in
    http://review.gluster.org/6452)

    Change-Id: Ia6c538fe363905588dcf4fc4783804073956a586
    BUG: 1088589
    Signed-off-by: Anand Avati <avati at redhat.com>
    Reviewed-on: http://review.gluster.org/7607
    Tested-by: Gluster Build System <jenkins at build.gluster.com>
    Reviewed-by: Vijay Bellur <vbellur at redhat.com>

--- Additional comment from Niels de Vos on 2014-09-22 08:38:11 EDT ---

A beta release for GlusterFS 3.6.0 has been released. Please verify if the
release solves this bug report for you. In case the glusterfs-3.6.0beta1
release does not have a resolution for this issue, leave a comment in this bug
and move the status to ASSIGNED. If this release fixes the problem for you,
leave a note and change the status to VERIFIED.

Packages for several distributions should become available in the near future.
Keep an eye on the Gluster Users mailinglist [2] and the update (possibly an
"updates-testing" repository) infrastructure for your distribution.

[1]
http://supercolony.gluster.org/pipermail/gluster-users/2014-September/018836.html
[2] http://supercolony.gluster.org/pipermail/gluster-users/


Referenced Bugs:

https://bugzilla.redhat.com/show_bug.cgi?id=1088589
[Bug 1088589] Failure in gf_log_init reopening stderr
https://bugzilla.redhat.com/show_bug.cgi?id=1103413
[Bug 1103413] Failure in gf_log_init reopening stderr
-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=5yNA6sJPV3&a=cc_unsubscribe


More information about the Bugs mailing list