Re: [PATCH 1/1] bad block is after superblock and bitmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 07/19/2019 07:59 PM, Hou Tao wrote:
Hi,

On 2019/7/19 16:49, Xiao Ni wrote:
Now it calculate bad block offset by bm_offset + bm_space. It should add sb_offset.

Fixes: 1b7eb672(super1: fix setting bad block log offset in write_init_super1())
Signed-off-by: Xiao Ni <xni@xxxxxxxxxx>
---
  super1.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/super1.c b/super1.c
index b85dc20..682655a 100644
--- a/super1.c
+++ b/super1.c
@@ -2012,7 +2012,7 @@ static int write_init_super1(struct supertype *st)
  			sb->data_size = __cpu_to_le64(dsize - data_offset);
  			if (data_offset >= sb_offset+bm_offset+bm_space+8) {
  				sb->bblog_size = __cpu_to_le16(8);
-				sb->bblog_offset = __cpu_to_le32(bm_offset +
+				sb->bblog_offset = __cpu_to_le32(sb_offset + bm_offset +
  								 bm_space);
bblog_offset is used as the signed offset from the sb_offset not the offset from
the start of the device, so I don't think the addition of sb_offset is correct.
Hi Tao

Thanks for pointing the error. You are right. Bitmap and bad block's offset are all
start from the superblock. I thought wrongly.

Regards
Xiao



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux