]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
nilfs2: simplify handling of active state of segments fix
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Sun, 29 Mar 2009 15:50:19 +0000 (00:50 +0900)
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Mon, 13 Apr 2009 00:53:51 +0000 (09:53 +0900)
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>
fs/nilfs2/sufile.c

index c774cf397e2fab6e43065b4ff18e58bcb4192040..1ef2b4d9d794e2290a84650a4483bec168e5d402 100644 (file)
@@ -625,7 +625,7 @@ ssize_t nilfs_sufile_get_suinfo(struct inode *sufile, __u64 segnum,
                        si[i + j].sui_nblocks = le32_to_cpu(su->su_nblocks);
                        si[i + j].sui_flags = le32_to_cpu(su->su_flags) &
                                ~(1UL << NILFS_SEGMENT_USAGE_ACTIVE);
-                       if (nilfs_segment_is_active(nilfs, segnum + i + j))
+                       if (nilfs_segment_is_active(nilfs, segnum + j))
                                si[i + j].sui_flags |=
                                        (1UL << NILFS_SEGMENT_USAGE_ACTIVE);
                }