<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On Thursday 02 April 2015 01:00 PM,
      Pranith Kumar Karampuri wrote:<br>
    </div>
    <blockquote cite="mid:551CF02F.3080909@redhat.com" type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      <br>
      <div class="moz-cite-prefix">On 04/02/2015 12:27 AM, Raghavendra
        Talur wrote:<br>
      </div>
      <blockquote
cite="mid:CALzJ8sPOow6Zps7xxr030XQNx5=GEY9qZzN_CxzENWPsDOKf8A@mail.gmail.com"
        type="cite">
        <div dir="ltr"><br>
          <div class="gmail_extra"><br>
            <div class="gmail_quote">On Wed, Apr 1, 2015 at 10:34 PM,
              Justin Clift <span dir="ltr">&lt;<a
                  moz-do-not-send="true"
                  href="mailto:justin@gluster.org" target="_blank">justin@gluster.org</a>&gt;</span>
              wrote:<br>
              <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span
                  class="">On 1 Apr 2015, at 10:57, Emmanuel Dreyfus
                  &lt;<a moz-do-not-send="true"
                    href="mailto:manu@netbsd.org">manu@netbsd.org</a>&gt;

                  wrote:<br>
                  &gt; Hi<br>
                  &gt;<br>
                  &gt; crypt.t was recently broken in NetBSD regression.
                  The glusterfs returns<br>
                  &gt; a node with file type invalid to FUSE, and that
                  breaks the test.<br>
                  &gt;<br>
                  &gt; After running a git bisect, I found the offending
                  commit after which<br>
                  &gt; this behavior appeared:<br>
                  &gt;    8a2e2b88fc21dc7879f838d18cd0413dd88023b7<br>
                  &gt;    mem-pool: invalidate memory on GF_FREE to aid
                  debugging<br>
                  &gt;<br>
                  &gt; This means the bug has always been there, but
                  this debugging aid<br>
                  &gt; caused it to be reliable.<br>
                  <br>
                </span>Sounds like that commit is a good win then. :)<br>
                <br>
                Harsha/Pranith/Lala, your names are on the git blame for
                crypt.c...<br>
                any ideas? :)<br>
                <br>
              </blockquote>
              <div><br>
              </div>
              <div>I found one issue that local is not allocated using
                GF_CALLOC and with a mem-type.</div>
              <div>This is a patch which *might* fix it.</div>
              <div><br>
              </div>
              <div>diff --git
                a/xlators/encryption/crypt/src/crypt-mem-types.h
                b/xlators/encryption/crypt/src/crypt-mem-types.h</div>
              <div>index 2eab921..c417b67 100644</div>
              <div>--- a/xlators/encryption/crypt/src/crypt-mem-types.h</div>
              <div>+++ b/xlators/encryption/crypt/src/crypt-mem-types.h</div>
              <div>@@ -24,6 +24,7 @@ enum gf_crypt_mem_types_ {</div>
              <div>        gf_crypt_mt_key,</div>
              <div>        gf_crypt_mt_iovec,</div>
              <div>        gf_crypt_mt_char,</div>
              <div>+        gf_crypt_mt_local,</div>
              <div>        gf_crypt_mt_end,</div>
              <div> };</div>
              <div> </div>
              <div>diff --git a/xlators/encryption/crypt/src/crypt.c
                b/xlators/encryption/crypt/src/crypt.c</div>
              <div>index ae8cdb2..63c0977 100644</div>
              <div>--- a/xlators/encryption/crypt/src/crypt.c</div>
              <div>+++ b/xlators/encryption/crypt/src/crypt.c</div>
              <div>@@ -48,7 +48,7 @@ static crypt_local_t
                *crypt_alloc_local(call_frame_t *frame, xlator_t *this,</div>
              <div> {</div>
              <div>        crypt_local_t *local = NULL;</div>
              <div> </div>
              <div>-       local = mem_get0(this-&gt;local_pool);</div>
              <div>+        local = GF_CALLOC (sizeof (*local), 1,
                gf_crypt_mt_local);</div>
            </div>
          </div>
        </div>
      </blockquote>
      local is using the memory from pool earlier(i.e. with mem_get0()).
      Which seems ok to me. Changing it this way will include memory
      allocation in fop I/O path which is why xlators generally use the
      mem-pool approach.<br>
      <br>
      Pranith<br>
    </blockquote>
    <br>
    I think, crypt xlator should do a mem_put of local after doing
    STACK_UNWIND like other xlators which also use mem_get for local
    (such as AFR). I am suspecting crypt not doing mem_put might be the
    reason for the bug mentioned.<br>
    <br>
    Regards,<br>
    Raghavendra Bat<br>
    <br>
    <blockquote cite="mid:551CF02F.3080909@redhat.com" type="cite">
      <blockquote
cite="mid:CALzJ8sPOow6Zps7xxr030XQNx5=GEY9qZzN_CxzENWPsDOKf8A@mail.gmail.com"
        type="cite">
        <div dir="ltr">
          <div class="gmail_extra">
            <div class="gmail_quote">
              <div>        if (!local) {</div>
              <div>                gf_log(this-&gt;name, GF_LOG_ERROR,
                "out of memory");</div>
              <div>                return NULL;</div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>Niels should be able to recognize if this is
                sufficient fix or not.</div>
              <div><br>
              </div>
              <div>Thanks,</div>
              <div>Raghavendra Talur</div>
              <div> <br>
              </div>
              <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">+
                Justin<br>
                <br>
                --<br>
                GlusterFS - <a moz-do-not-send="true"
                  href="http://www.gluster.org" target="_blank">http://www.gluster.org</a><br>
                <br>
                An open source, distributed file system scaling to
                several<br>
                petabytes, and handling thousands of clients.<br>
                <br>
                My personal twitter: <a moz-do-not-send="true"
                  href="http://twitter.com/realjustinclift"
                  target="_blank">twitter.com/realjustinclift</a><br>
                <div class="">
                  <div class="h5"><br>
                    _______________________________________________<br>
                    Gluster-devel mailing list<br>
                    <a moz-do-not-send="true"
                      href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a><br>
                    <a moz-do-not-send="true"
                      href="http://www.gluster.org/mailman/listinfo/gluster-devel"
                      target="_blank">http://www.gluster.org/mailman/listinfo/gluster-devel</a><br>
                  </div>
                </div>
              </blockquote>
            </div>
            <br>
            <br clear="all">
            <div><br>
            </div>
            -- <br>
            <div class="gmail_signature">
              <div dir="ltr"><font color="#666666"><b>Raghavendra Talur </b></font>
                <div><br>
                </div>
              </div>
            </div>
          </div>
        </div>
      </blockquote>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Gluster-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a>
<a class="moz-txt-link-freetext" href="http://www.gluster.org/mailman/listinfo/gluster-devel">http://www.gluster.org/mailman/listinfo/gluster-devel</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>