Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174713
b: refs/heads/master
c: 050b414
h: refs/heads/master
i:
  174711: 22c6bd8
v: v3
  • Loading branch information
Ryusuke Konishi committed Nov 20, 2009
1 parent bfca32b commit 010cf7a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f021759d74d71bacc73fc3e00d6e3d35e1f2e123
refs/heads/master: 050b4142c9f3cb3a213f254bd1a1fa1476800585
26 changes: 19 additions & 7 deletions trunk/fs/nilfs2/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ int nilfs_search_super_root(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi,
struct nilfs_segsum_info ssi;
sector_t pseg_start, pseg_end, sr_pseg_start = 0;
sector_t seg_start, seg_end; /* range of full segment (block number) */
sector_t b, end;
u64 seg_seq;
__u64 segnum, nextnum = 0;
__u64 cno;
Expand All @@ -813,6 +814,11 @@ int nilfs_search_super_root(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi,
/* Calculate range of segment */
nilfs_get_segment_range(nilfs, segnum, &seg_start, &seg_end);

/* Read ahead segment */
b = seg_start;
while (b <= seg_end)
sb_breadahead(sbi->s_super, b++);

for (;;) {
/* Load segment summary */
ret = load_segment_summary(sbi, pseg_start, seg_seq, &ssi, 1);
Expand All @@ -835,14 +841,20 @@ int nilfs_search_super_root(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi,
ri->ri_nextnum = nextnum;
empty_seg = 0;

if (!NILFS_SEG_HAS_SR(&ssi) && !scan_newer) {
/* This will never happen because a superblock
(last_segment) always points to a pseg
having a super root. */
ret = NILFS_SEG_FAIL_CONSISTENCY;
goto failed;
}

if (pseg_start == seg_start) {
nilfs_get_segment_range(nilfs, nextnum, &b, &end);
while (b <= end)
sb_breadahead(sbi->s_super, b++);
}
if (!NILFS_SEG_HAS_SR(&ssi)) {
if (!scan_newer) {
/* This will never happen because a superblock
(last_segment) always points to a pseg
having a super root. */
ret = NILFS_SEG_FAIL_CONSISTENCY;
goto failed;
}
if (!ri->ri_lsegs_start && NILFS_SEG_LOGBGN(&ssi)) {
ri->ri_lsegs_start = pseg_start;
ri->ri_lsegs_start_seq = seg_seq;
Expand Down

0 comments on commit 010cf7a

Please sign in to comment.