* [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized
@ 2017-05-26 10:48 Richard Narron
2017-05-26 13:23 ` Jens Axboe
2017-05-26 14:31 ` Joe Perches
0 siblings, 2 replies; 9+ messages in thread
From: Richard Narron @ 2017-05-26 10:48 UTC (permalink / raw)
To: linux-kernel; +Cc: Christoph Hellwig, Jens Axboe, Andries Brouwer
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
Though all 3 of these BSD systems use UFS as a file system, only
FreeBSD uses relative start addresses in the subpartition
declarations.
The following patch fixes this for FreeBSD partitions and leaves
the code for OpenBSD and NetBSD intact:
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Andries Brouwer <aeb@cwi.nl>
Cc: linux-block@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Richard Narron <comet.berkeley@gmail.com>
---
Changelog v2->v3:
- Add Cc:
Changelog v1->v2: - Improve style, use +=
---
block/partitions/msdos.c | 2 ++
1 file changed, 2 insertions(+)
--- a/block/partitions/msdos.c 2015-12-27 18:17:37.000000000 -0800
+++ b/block/partitions/msdos.c 2015-12-29 10:44:25.813773357 -0800
@@ -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)
+ bsd_start += offset;
if (offset == bsd_start && size == bsd_size)
/* full parent partition, we have it already */
continue;
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized
2017-05-26 10:48 [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized Richard Narron
@ 2017-05-26 13:23 ` Jens Axboe
2017-05-26 14:31 ` Joe Perches
1 sibling, 0 replies; 9+ messages in thread
From: Jens Axboe @ 2017-05-26 13:23 UTC (permalink / raw)
To: Richard Narron, linux-kernel; +Cc: Christoph Hellwig, Andries Brouwer
On 05/26/2017 04:48 AM, 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
>
> Though all 3 of these BSD systems use UFS as a file system, only
> FreeBSD uses relative start addresses in the subpartition
> declarations.
>
> The following patch fixes this for FreeBSD partitions and leaves
> the code for OpenBSD and NetBSD intact:
I queued this up 3 days ago, and replied as such. There's no need
to keep sending it.
--
Jens Axboe
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized
2017-05-26 10:48 [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized Richard Narron
2017-05-26 13:23 ` Jens Axboe
@ 2017-05-26 14:31 ` Joe Perches
2017-05-26 23:30 ` Richard Narron
1 sibling, 1 reply; 9+ messages in thread
From: Joe Perches @ 2017-05-26 14:31 UTC (permalink / raw)
To: Richard Narron, linux-kernel
Cc: Christoph Hellwig, Jens Axboe, Andries Brouwer
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)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized
2017-05-26 14:31 ` Joe Perches
@ 2017-05-26 23:30 ` Richard Narron
2017-05-26 23:42 ` Joe Perches
0 siblings, 1 reply; 9+ messages in thread
From: Richard Narron @ 2017-05-26 23:30 UTC (permalink / raw)
To: Joe Perches; +Cc: linux-kernel, Christoph Hellwig, Jens Axboe, Andries Brouwer
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized
2017-05-26 23:30 ` Richard Narron
@ 2017-05-26 23:42 ` Joe Perches
[not found] ` <alpine.LNX.2.21.1705261737590.2924@joy.test>
0 siblings, 1 reply; 9+ messages in thread
From: Joe Perches @ 2017-05-26 23:42 UTC (permalink / raw)
To: Richard Narron
Cc: linux-kernel, Christoph Hellwig, Jens Axboe, Andries Brouwer
On Fri, 2017-05-26 at 16:30 -0700, Richard Narron wrote:
> 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.
That really doesn't matter.
Your code stores "bsd\0\0" and not just "bsd\0"
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized
@ 2017-05-26 4:52 Richard Narron
0 siblings, 0 replies; 9+ messages in thread
From: Richard Narron @ 2017-05-26 4:52 UTC (permalink / raw)
To: linux-block; +Cc: Christoph Hellwig, Jens Axboe, Andries Brouwer
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
Though all 3 of these BSD systems use UFS as a file system, only
FreeBSD uses relative start addresses in the subpartition
declarations.
The following patch fixes this for FreeBSD partitions and leaves
the code for OpenBSD and NetBSD intact:
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Andries Brouwer <aeb@cwi.nl>
Cc: linux-block@vger.kernel.org
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Richard Narron <comet.berkeley@gmail.com>
---
Changelog v2->v3:
- Add Cc:
Changelog v1->v2:
- Improve style, use +=
---
block/partitions/msdos.c | 2 ++
1 file changed, 2 insertions(+)
--- a/block/partitions/msdos.c 2015-12-27 18:17:37.000000000 -0800
+++ b/block/partitions/msdos.c 2015-12-29 10:44:25.813773357 -0800
@@ -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)
+ bsd_start += offset;
if (offset == bsd_start && size == bsd_size)
/* full parent partition, we have it already */
continue;
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-05-27 4:24 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-26 10:48 [PATCH v3 1/1] partitions/msdos: FreeBSD UFS2 file systems are not recognized Richard Narron
2017-05-26 13:23 ` Jens Axboe
2017-05-26 14:31 ` Joe Perches
2017-05-26 23:30 ` Richard Narron
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
-- strict thread matches above, loose matches on Subject: below --
2017-05-26 4:52 Richard Narron
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.