Linux ocfs2 filesystem development
 help / color / mirror / Atom feed
From: Zhangguanghui <zhang.guanghui@h3c.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] o2net_fill_node_map reviews, thanks
Date: Sat, 6 Jun 2015 13:11:07 +0000	[thread overview]
Message-ID: <2015060621110661541823@h3c.com> (raw)
In-Reply-To: 2015052520192992179519@h3c.com


Hi
1. in the callback o2net_fill_node_map -> o2net_tx_can_proceed()
2. if the function o2net_tx_can_proceed returns false,  then "ret" and sc are uninialized,
and re-using the value from the previous iteration.  I think this is not reasonable.
I do not know whether to hide a bug.
checking the return value is harmless and robustness.

Finally, any feedback about this process (positive or negative) would be  greatly appreciated.

/* Get a map of all nodes to which this node is currently connected to */

void o2net_fill_node_map(unsigned long *map, unsigned bytes)
{
        struct o2net_sock_container *sc = NULL;
        int node, ret = 0;
        BUG_ON(bytes < (BITS_TO_LONGS(O2NM_MAX_NODES) * sizeof(unsigned long)));
        memset(map, 0, bytes);
        for (node = 0; node < O2NM_MAX_NODES; ++node) {
                if (!o2net_tx_can_proceed(o2net_nn_from_num(node), &sc, &ret))
                        continue;
                if (!ret) {
                        set_bit(node, map);
                        sc_put(sc)

               }

              +   sc = NULL;

              +  ret=0;

        }
}

-------------------------------------------------------------------------------------------------------------------------------------
????????????????????????????????????????
????????????????????????????????????????
????????????????????????????????????????
???
This e-mail and its attachments contain confidential information from H3C, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20150606/8ee03875/attachment.html 

      reply	other threads:[~2015-06-06 13:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-25  8:22 [Ocfs2-devel] LVB patch for reviews, thanks Guozhonghua
2015-05-25 12:19 ` Zhangguanghui
2015-06-06 13:11   ` Zhangguanghui [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2015060621110661541823@h3c.com \
    --to=zhang.guanghui@h3c.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox