[Bugs] [Bug 1227916] New: auth_cache_entry structure barely gets cached

bugzilla at redhat.com bugzilla at redhat.com
Wed Jun 3 19:52:09 UTC 2015


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

            Bug ID: 1227916
           Summary: auth_cache_entry structure barely gets cached
           Product: GlusterFS
           Version: 3.7.0
         Component: nfs
          Severity: medium
          Priority: medium
          Assignee: ndevos at redhat.com
          Reporter: ndevos at redhat.com
                CC: bugs at gluster.org, gluster-bugs at redhat.com
        Depends On: 1226714
            Blocks: 1227206 (glusterfs-3.7.2)



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

Description of problem:
The "struct auth_cache_entry" gets put into a dictionary, with a hash-string of
the client and the requested mount-point/directory as key. However, due to a
programming error, the hash-string is often set to NULL.

Version-Release number of selected component (if applicable):
3.7 and mainline

Additional notes:
Noticed during code-review.

--- Additional comment from Anand Avati on 2015-06-03 10:13:04 CEST ---

REVIEW: http://review.gluster.org/11019 (nfs: allocate and return the hashkey
for the auth_cache_entry) posted (#2) for review on master by Niels de Vos
(ndevos at redhat.com)

--- Additional comment from Anand Avati on 2015-06-03 12:10:28 CEST ---

REVIEW: http://review.gluster.org/11019 (nfs: allocate and return the hashkey
for the auth_cache_entry) posted (#3) for review on master by Niels de Vos
(ndevos at redhat.com)

--- Additional comment from Anand Avati on 2015-06-03 21:51:17 CEST ---

COMMIT: http://review.gluster.org/11019 committed in master by Niels de Vos
(ndevos at redhat.com) 
------
commit b8b59fea7822f9ab1e10d7a3f730354fe82a6097
Author: Niels de Vos <ndevos at redhat.com>
Date:   Sun May 31 22:29:11 2015 +0200

    nfs: allocate and return the hashkey for the auth_cache_entry

    The allocation of the hashkey was never returned to the calling
    function.

    Allocating it with alloca() puts it on the stack, returning from the
    function makes the pointer invalid. Functions that are annotated with
    "inline" and call alloca(), will not always be inlined. Returning a
    pointer allocated with alloca() is in those cases not correct. One such
    confirmation was provided by GCC developer Alexandre Oliva:
     - http://gcc.gnu.org/ml/gcc-help/2004-04/msg00158.html

    It is more correct to call GF_MALLOC() and GF_FREE() for the hashkey. If
    this would result in preformance hit, we can always think of using
    alloca() again and turn make_hashkey() into a macro (yuck).

    Change-Id: Ia86a1f79d33240af4713bfb92f702b0ee6e87eb7
    BUG: 1226714
    Signed-off-by: Niels de Vos <ndevos at redhat.com>
    Reviewed-on: http://review.gluster.org/11019
    Reviewed-by: Kaleb KEITHLEY <kkeithle at redhat.com>
    Reviewed-by: jiffin tony Thottan <jthottan at redhat.com>
    Reviewed-by: soumya k <skoduri at redhat.com>
    Tested-by: Gluster Build System <jenkins at build.gluster.com>


Referenced Bugs:

https://bugzilla.redhat.com/show_bug.cgi?id=1226714
[Bug 1226714] auth_cache_entry structure barely gets cached
https://bugzilla.redhat.com/show_bug.cgi?id=1227206
[Bug 1227206] GlusterFS 3.7.2 tracker
-- 
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=vGuRXouLlI&a=cc_unsubscribe


More information about the Bugs mailing list