mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Narron <comet.berkeley@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Jens Axboe <axboe@kernel.dk>, Andries Brouwer <aeb@cwi.nl>
Subject: Re: [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized
Date: Fri, 26 May 2017 16:30:20 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LNX.2.21.1705261612360.2379@joy.test> (raw)
In-Reply-To: <1495809112.29207.30.camel@perches.com>

On Fri, 26 May 2017, Joe Perches wrote:

> On Fri, 2017-05-26 at 03:48 -0700, Richard Narron wrote:
>> The code in block/partitions/msdos.c recognizes FreeBSD, OpenBSD
>> and NetBSD partitions and does a reasonable job picking out OpenBSD
>> and NetBSD UFS subpartitions.
>>
>> But for FreeBSD the subpartitions are always "bad".
>>
>>      Kernel: <bsd:bad subpartition - ignored
> []
>>   block/partitions/msdos.c | 2 ++
> []
>> @@ -300,6 +300,8 @@ static void parse_bsd(struct parsed_part
>>   			continue;
>>   		bsd_start = le32_to_cpu(p->p_offset);
>>   		bsd_size = le32_to_cpu(p->p_size);
>> +		if (memcmp(flavour, "bsd\0", 4) == 0)
>
> Weird code.  Why not:
>
> 		if (strcmp(flavor, "bsd") == 0)
>

I instinctively trust the memcmp function as it seems more like 
assembly language to me and more straight forward and more reliable than 
strcmp.

I'm new to this forum and did not know who you were so I looked up your 
name in old threads and oddly enough found this thread about a strcmp bug:

http://marc.info/?l=linux-kernel&m=125848558316468&w=2

http://marc.info/?l=linux-kernel&m=125847802903422&w=2

  reply	other threads:[~2017-05-27  1:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26 10:48 Richard Narron
2017-05-26 13:23 ` Jens Axboe
2017-05-26 14:31 ` Joe Perches
2017-05-26 23:30   ` Richard Narron [this message]
2017-05-26 23:42     ` Joe Perches
     [not found]       ` <alpine.LNX.2.21.1705261737590.2924@joy.test>
2017-05-27  1:54         ` Joe Perches
2017-05-27  3:20           ` Richard Narron
2017-05-27  3:48             ` Joe Perches

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=alpine.LNX.2.21.1705261612360.2379@joy.test \
    --to=comet.berkeley@gmail.com \
    --cc=aeb@cwi.nl \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®