All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jes Sorensen <jsorensen@fb.com>
To: Xiao Ni <xni@redhat.com>, linux-raid@vger.kernel.org
Cc: ncroxon@redhat.com, pmenzel@molgen.mpg.de, antlists@youngman.org.uk
Subject: Re: [mdadm PATCH 1/1] Fix a build error
Date: Sat, 30 Sep 2017 09:08:28 -0400	[thread overview]
Message-ID: <7458ed3a-f510-f192-b07f-c61291ffd07d@fb.com> (raw)
In-Reply-To: <67315e6f-1298-7199-7dee-4f2c72b5abc0@redhat.com>

On 09/29/2017 09:19 PM, Xiao Ni wrote:
> 
> 
> On 09/30/2017 05:47 AM, Jes Sorensen wrote:
>> On 09/19/2017 11:48 PM, Xiao Ni wrote:
>>> On the s390 platform the build fails with the error below.
>>> Manage.c: In function 'Manage_subdevs':
>>> Manage.c:1502:5: error: passing argument 3 of 'fstat_is_blkdev' from 
>>> incompatible pointer type [-Werror]
>>>       fstat_is_blkdev(tfd, dv->devname, &rdev);
>>>       ^
>>> In file included from Manage.c:25:0:
>>> mdadm.h:1446:12: note: expected 'dev_t *' but argument is of type 
>>> 'long unsigned int *'
>>>
>>> It was introduced by commit 0a6bff09 (mdadm/util: unify fstat
>>> checking blkdev into function). It needs to pass a type 'dev_t'
>>> argument to fstat_is_blkdev, but it passes a type 'unsigned
>>> long' argument. So use a temporary variable to fix this.
>>>
>>> Signed-off-by: Xiao Ni <xni@redhat.com>
>>> Suggested-by: Paul Menzel <pmenzel@molgen.mpg.de>
>>> Suggested-by: Wols Lists <antlists@youngman.org.uk>
>>> ---
>>>   Manage.c | 6 ++++--
>>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> So having a quick look at this, I have to say I don't like the casting 
>> back and forth. The fact that we carry rdev in an unsigned long in 
>> Manage_subdevs() seems dubious to me.
>>
>> Did you look into what the implications would be to change it to a dev_t?
>>
>> Jes
> 
> Hi Jes
> 
> Do you mean define rdev as dev_t at first? It will change a lot if we do 
> so. The argument rdev is passed
> to many functions now. Such as Manage_add, Manage_remove, 
> hot_remove_disk and so on. So I think
> it's the reason why we carry rdev in an unsigned long in Manage_subddevs().
> 
> Do you have a better solution?

I looked at the other functions and they all carry rdev as a dev_t so I 
made it the same in Manage_subdevs(). We may have to clean up some more 
functions to take the right input argument, but it looks like the 
correct solution to me.

Cheers,
Jes



  reply	other threads:[~2017-09-30 13:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20  3:48 [mdadm PATCH 1/1] Fix a build error Xiao Ni
2017-09-29 21:47 ` Jes Sorensen
2017-09-30  1:19   ` Xiao Ni
2017-09-30 13:08     ` Jes Sorensen [this message]
2017-09-30 14:12       ` Xiao Ni
2017-10-01 22:08         ` Jes Sorensen
2017-10-02  9:12           ` Xiao Ni

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=7458ed3a-f510-f192-b07f-c61291ffd07d@fb.com \
    --to=jsorensen@fb.com \
    --cc=antlists@youngman.org.uk \
    --cc=linux-raid@vger.kernel.org \
    --cc=ncroxon@redhat.com \
    --cc=pmenzel@molgen.mpg.de \
    --cc=xni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.