nilfs2: simplify handling of active state of segments fix

This fixes a bug of ("nilfs2: simplify handling of active state of
segments") patch. The patch did not take account that a base index is
increased in nilfs_sufile_get_suinfo() function if requested entries
go across block boundary on sufile.

Due to this bug, the active flag sometimes appears on wrong segments
and has induced malfunction of garbage collection.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>

+1 -1
+1 -1
fs/nilfs2/sufile.c
··· 625 si[i + j].sui_nblocks = le32_to_cpu(su->su_nblocks); 626 si[i + j].sui_flags = le32_to_cpu(su->su_flags) & 627 ~(1UL << NILFS_SEGMENT_USAGE_ACTIVE); 628 - if (nilfs_segment_is_active(nilfs, segnum + i + j)) 629 si[i + j].sui_flags |= 630 (1UL << NILFS_SEGMENT_USAGE_ACTIVE); 631 }
··· 625 si[i + j].sui_nblocks = le32_to_cpu(su->su_nblocks); 626 si[i + j].sui_flags = le32_to_cpu(su->su_flags) & 627 ~(1UL << NILFS_SEGMENT_USAGE_ACTIVE); 628 + if (nilfs_segment_is_active(nilfs, segnum + j)) 629 si[i + j].sui_flags |= 630 (1UL << NILFS_SEGMENT_USAGE_ACTIVE); 631 }