[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haiku-commits
Subject:    [haiku-commits] Re: haiku: hrev53429 - in src/add-ons/kernel/file_systems: ext2 bfs
From:       Stephan_Aßmus <superstippi () gmx ! de>
Date:       2019-08-30 19:26:47
Message-ID: c30d1289-aa60-5875-affa-385e909c1e37 () gmx ! de
[Download RAW message or body]

Hi,

Am 30.08.2019 um 21:18 schrieb waddlesplash:
> diff --git a/src/add-ons/kernel/file_systems/bfs/Volume.cpp \
> b/src/add-ons/kernel/file_systems/bfs/Volume.cpp index ca3241fd24..2b06068c3f \
>                 100644
> --- a/src/add-ons/kernel/file_systems/bfs/Volume.cpp
> +++ b/src/add-ons/kernel/file_systems/bfs/Volume.cpp
> @@ -828,8 +828,12 @@ Volume::_EraseUnusedBootBlock()
> {
> 	const int32 blockSize = 512;
> 	const char emptySector[blockSize] = { 0 };
> +	// Erase boot block if any
> 	if (write_pos(fDevice, 0, emptySector, blockSize) != blockSize)
> 		return B_IO_ERROR;
> +	// Erase ext2 superblock if any
> +	if (write_pos(fDevice, 1024, emptySector, blockSize) != blockSize)
> +		return B_IO_ERROR;

Is it OK to just write at an offset without checking the partition size?
What if the partition is smaller than that? (I know it doesn't make much
sense for it to be smaller, but still.)

Best regards,
-Stephan


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic