diff options
author | Richard <richard@aaazen.com> | 2017-05-21 12:27:00 -0700 |
---|---|---|
committer | Sasha Levin <alexander.levin@verizon.com> | 2017-06-25 22:02:20 -0400 |
commit | afae1d9da32e2b8fec14884276fc0748f6019811 (patch) | |
tree | f7c45244ab32d5e372f8848c4834f5e20e35632d /block | |
parent | 7f6abe4c05600dae70b4a0037be77b752f57a077 (diff) |
partitions/msdos: FreeBSD UFS2 file systems are not recognized
[ Upstream commit 223220356d5ebc05ead9a8d697abb0c0a906fc81 ]
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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/partitions/msdos.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block/partitions/msdos.c b/block/partitions/msdos.c index 93e7c1b32edd..5610cd537da7 100644 --- a/block/partitions/msdos.c +++ b/block/partitions/msdos.c @@ -300,6 +300,8 @@ static void parse_bsd(struct parsed_partitions *state, 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; |