Skip to content

Commit 2232203

Browse files
Richardaxboe
authored andcommitted
partitions/msdos: FreeBSD UFS2 file systems are not recognized
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: Signed-off-by: Richard Narron <comet.berkeley@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
1 parent 7bd897c commit 2232203

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

block/partitions/msdos.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,8 @@ static void parse_bsd(struct parsed_partitions *state,
300300
continue;
301301
bsd_start = le32_to_cpu(p->p_offset);
302302
bsd_size = le32_to_cpu(p->p_size);
303+
if (memcmp(flavour, "bsd\0", 4) == 0)
304+
bsd_start += offset;
303305
if (offset == bsd_start && size == bsd_size)
304306
/* full parent partition, we have it already */
305307
continue;

0 commit comments

Comments
 (0)