linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boaz Harrosh <ooo@electrozaur.com>
To: Nick Desaulniers <ndesaulniers@google.com>,
	Nathan Chancellor <natechancellor@gmail.com>
Cc: bvanassche@acm.org,
	"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	hch@infradead.org
Subject: Re: [PATCH] libosd: Remove ignored __weak attribute
Date: Thu, 1 Nov 2018 03:15:56 +0200	[thread overview]
Message-ID: <65187f1a-4e67-3d96-ea97-e37c8bf87e48@electrozaur.com> (raw)
In-Reply-To: <CAKwvOdnwmf47_m_0K5OCLmXbrkLNnekpNOPCCMeJqkuqKUbQ-A@mail.gmail.com>

On 26/10/18 20:54, Nick Desaulniers wrote:
<>
> 
> It's hard to say without knowing the original intent of the code.
>>From the variable's identifier and fact that it's global, I *assume*
> that we want only 1 struct osd_obj_id which is the root, hence the
> identifier `osd_root_object`.  It has 4 references in the entire
> kernel; it doesn't make sense to my why those references would want to
> be referring to two different instances of `osd_root_object`.  Maybe
> the maintainers can clarify if 2 instances is the intent?
> 
> Further complicated is the use of the __weak attribute AND the
> compiler flag -fno-common (which the kernel sets in the top level
> Makefile).  Also, it seems that ODR is a C++ concept; it's not clear
> to me if there's semantic differences with C or not (I don't think so
> in this case, but I've learned not to bet on subtle semantic
> differences between the languages not existing).
> 
> __attribute__((weak)) AND static on a global variable declared in a
> header raises many red flags to me.  Was weak added to work around an
> ODR link error?
> 
> If creating one instance of this variable is a functional change, I
> can't help but suspect the original code was wrong.  But maybe Bart,
> Boaz, or Christoph can clarify or have more thoughts on this?  Looks
> like Boaz added this header in commit de258bf5e638 ("[SCSI] libosd:
> OSDv1 Headers").
> 

Sorry for the late response. Was off line for a bit.

The original patch and all its permutations are all correct
the definition of osd_root_object is just a fancy type cast of
couple of zeros. IE a couple of zeroes with the right type. So they
can be simply compared to retuned and sent line content. So it does
not matter at all what change is accepted.

I'm so sorry for your trouble and test development. It could all
be saved if I was noticing this thread.

I will ACK again the original simple V2 patch.

Thanks
Boaz

<>

  parent reply	other threads:[~2018-11-01  1:16 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-30 20:54 [PATCH] libosd: Remove ignored __weak attribute Nathan Chancellor
2018-10-01 22:47 ` Nick Desaulniers
2018-10-02  1:16 ` Bart Van Assche
2018-10-02  6:55   ` Nathan Chancellor
2018-10-02 14:56   ` Christoph Hellwig
2018-10-02 16:59     ` Boaz Harrosh
2018-10-02 17:24   ` Nick Desaulniers
2018-10-02 17:57     ` Bart Van Assche
2018-10-02 22:33       ` Nick Desaulniers
2018-10-02 23:06         ` Bart Van Assche
2018-10-25 21:31           ` Nathan Chancellor
2018-10-25 22:02             ` Nick Desaulniers
2018-10-25 22:55               ` Nathan Chancellor
2018-10-26 17:54                 ` Nick Desaulniers
2018-10-26 18:01                   ` Bart Van Assche
2018-10-26 18:05                     ` Nathan Chancellor
2018-10-26 18:31                       ` Nick Desaulniers
2018-10-26 19:22                         ` Linus Torvalds
2018-10-26 20:05                           ` Nick Desaulniers
2018-10-26 20:42                             ` Linus Torvalds
2018-10-26 21:02                               ` Nick Desaulniers
2018-10-26 21:00                     ` Nick Desaulniers
2018-10-26 21:30                       ` Bart Van Assche
2018-10-26 21:36                         ` Nick Desaulniers
2018-10-26 21:59                           ` Bart Van Assche
2018-10-26 22:07                             ` Nick Desaulniers
2018-10-26 22:24                               ` Bart Van Assche
2018-10-27 13:28                                 ` Martin K. Petersen
2018-10-28 15:44                                   ` Christoph Hellwig
2018-11-01  1:05                                   ` Boaz Harrosh
2018-10-27  3:35                               ` Theodore Y. Ts'o
2018-10-27  6:15                                 ` Bart Van Assche
2018-10-27  6:25                                   ` Nathan Chancellor
2018-11-01  1:15                   ` Boaz Harrosh [this message]
2018-11-01  1:39             ` Boaz Harrosh
2018-11-01  1:44               ` Nathan Chancellor
2019-01-26  6:47 ` [PATCH RESEND] " Nathan Chancellor

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=65187f1a-4e67-3d96-ea97-e37c8bf87e48@electrozaur.com \
    --to=ooo@electrozaur.com \
    --cc=bvanassche@acm.org \
    --cc=hch@infradead.org \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.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;
as well as URLs for NNTP newsgroup(s).