pon_title"> pon_logo">LXR linux/fs/nilfs2/recovery.c
pon_version"> <<
>>
Prefs
   1/*
   2 * recovery.c - NILFS recovery logic
   3 *
   4 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation.
   5 *
   6 * This program is free software; you can redistribute it and/or modify
   7 * it under the terms of the GNU General Public License as published by
   8 * the Free Software Foundation; either version 2 of the License, or
   9 * (at your option) any later version.
  10 *
  11 * This program is distributed in the hope that it will be useful,
  12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14 * GNU General Public License for more details.
  15 *
  16 * You should have received a copy of the GNU General Public License
  17 * along with this program; if not, write to the Free Software
  18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  19 *
  20 * Written by Ryusuke Konishi <ryusuke@osrg.net>
  21 */
  22
  23#include <linux/buffer_head.h>
  24#include <linux/blkdev.h>
  25#include <linux/swap.h>
  26#include <linux/slab.h>
  27#include <linux/crc32.h>
  28#include "nilfs.h"
  29#include "segment.h"
  30#include "sufile.h"
  31#include "page.h"
  32#include "segbuf.h"
  33
  34/*
  35 * Segment check result
  36 */
  37enum {
  38        NILFS_SEG_VALID,
  39        NILFS_SEG_NO_SUPER_ROOT,
  40        NILFS_SEG_FAIL_IO,
  41        NILFS_SEG_FAIL_MAGIC,
  42        NILFS_SEG_FAIL_SEQ,
  43        NILFS_SEG_FAIL_CHECKSUM_SUPER_ROOT,
  44        NILFS_SEG_FAIL_CHECKSUM_FULL,
  45        NILFS_SEG_FAIL_CONSISTENCY,
  46};
  47
  48/* work structure for recovery */
  49struct nilfs_recovery_block {
  50        ino_t ino;              /* Inode number of the file that this block
  51                                   belongs to */
  52        sector_t blocknr;       /* block number */
  53        __u64 vblocknr;         /* virtual block number */
  54        unsigned long blkoff;   /* File offset of the data block (per block) */
  55        struct list_head list;
  56};
  57
  58
  59static int nilfs_warn_segment_error(int err)
  60{
  61        switch (err) {
  62        case NILFS_SEG_FAIL_IO:
  63                printk(KERN_WARNING
  64                       "NILFS warning: I/O error on loading last segment\n");
  65                return -EIO;
  66        case NILFS_SEG_FAIL_MAGIC:
  67                printk(KERN_WARNING
  68                       "NILFS warning: Segment magic number invalid\n");
  69                break;
  70        case NILFS_SEG_FAIL_SEQ:
  71                printk(KERN_WARNING
  72                       "NILFS warning: Sequence number mismatch\n");
  73                break;
  74        case NILFS_SEG_FAIL_CHECKSUM_SUPER_ROOT:
  75                printk(KERN_WARNING
  76                       "NILFS warning: Checksum error in super root\n");
  77                break;
  78        case NILFS_SEG_FAIL_CHECKSUM_FULL:
  79                printk(KERN_WARNING
  80                       "NILFS warning: Checksum error in segment payload\n");
  81                break;
  82        case NILFS_SEG_FAIL_CONSISTENCY:
  83                printk(KERN_WARNING
  84                       "NILFS warning: Inconsistent segment\n");
  85                break;
  86        case NILFS_SEG_NO_SUPER_ROOT:
  87                printk(KERN_WARNING
  88                       "NILFS warning: No super root in the last segment\n");
  89                break;
  90        }
  91        return -EINVAL;
  92}
  93
  94/**
  95 * nilfs_compute_checksum - compute checksum of blocks continuously
  96 * @nilfs: nilfs object
  97 * @bhs: buffer head of start block
  98 * @sum: place to store result
  99 * @offset: offset bytes in the first block
 100 * @check_bytes: number of bytes to be checked
 101 * @start: DBN of start block
 102 * @nblock: number of blocks to be checked
 103 */
 104static int nilfs_compute_checksum(struct the_nilfs *nilfs,
 105                                  struct buffer_head *bhs, u32 *sum,
 106                                  unsigned long offset, u64 check_bytes,
 107                                  sector_t start, unsigned long nblock)
 108{
 109        unsigned int blocksize = nilfs->ns_blocksize;
 110        unsigned long size;
 111        u32 crc;
 112
 113        BUG_ON(offset >= blocksize);
 114        check_bytes -= offset;
 115        size = min_t(u64, check_bytes, blocksize - offset);
 116        crc = crc32_le(nilfs->ns_crc_seed,
 117                       (unsigned char *)bhs->b_data + offset, size);
 118        if (--nblock > 0) {
 119                do {
 120                        struct buffer_head *bh;
 121
 122                        bh = __bread(nilfs->ns_bdev, ++start, blocksize);
 123                        if (!bh)
 124                                return -EIO;
 125                        check_bytes -= size;
 126                        size = min_t(u64, check_bytes, blocksize);
 127                        crc = crc32_le(crc, bh->b_data, size);
 128                        brelse(bh);
 129                } while (--nblock > 0);
 130        }
 131        *sum = crc;
 132        return 0;
 133}
 134
 135/**
 136 * nilfs_read_super_root_block - read super root block
 137 * @nilfs: nilfs object
 138 * @sr_block: disk block number of the super root block
 139 * @pbh: address of a buffer_head pointer to return super root buffer
 140 * @check: CRC check flag
 141 */
 142int nilfs_read_super_root_block(struct the_nilfs *nilfs, sector_t sr_block,
 143                                struct buffer_head **pbh, int check)
 144{
 145        struct buffer_head *bh_sr;
 146        struct nilfs_super_root *sr;
 147        u32 crc;
 148        int ret;
 149
 150        *pbh = NULL;
 111        b">bh = __bread(nilfs->ns_bdr_t sr_blze = nilfs->ns_block> > 0);
  52            __br    if (!b)> > 0) {
  83                pbh = NILFS_SEG_FAI > 0);
 124        gopoih =   55 133}
133}
 147        nilfs_super_rod char *)b">bh->b_ > 0);
 118    a>, int ch > 0) {
 129               (u/a>->check_bypbh = __bread(bh->> 0);
  81            a>, int check_byp= 0 ||u/a>->check_byock = nilfs->ns_block> > 0) {
 122                        pbh = NILFS_SEG_FAIL_CHECKSUM_SUPER_ > 0);
  63                gopoih =   64         133}
  65            a>, int nilfs_compute_check133}
 106                    fs *nilfs, b, &->cns_bofread(bh->ilfs, check_block,
  67                    fs *sr_blz1)> > 0) {
  68                        pbh = NILFS_SEG_FAI > 0);
  69                gopoih =  120         133}
  71            a>, int !pbh = __bread(bh->> > 0) {
  72                        pbh = NILFS_SEG_FAIL_CHECKSUM_SUPER_ > 0);
  73                gopoih =   64         133}
  55 133}
  76        *pbh = bh_sr;
  77        return 0;
  58
 h = :
  50        brelse(b)return 0;
 121
u32 :
  83       a>, int nilfs_warn_segment_er         133}
133}
 136/**
 137nillog">buferot_block -mmary >bufero number pecifi  unsheck flag
 138 * @nilfs: nilfs object
 139:: DBN of stask block numbernsheck flag
 140 *r_head pointer to ror in  -mmary /* work seck flag
 141 */
 104buffer_he/
int buferot_block" class="sref">nillog">buferot_block(struct the_nilfs *nilfs, sector_t sector_t" class="sre_"sref">ck_block,
 124              ock(struct  **)
> 0) {
 146        struct buffer_head *bh_sr;
  57
  38        b">bh = __bread(nilfs->ns_bdr_t sector_t" class="sre_"sref">ck_blze = nilfs->ns_block> > 0);
  69    a>, int bheck)
 120                *sulock(struct b">bh->b_ > 0);
  91       ad *bh_sr;
  92}
  93
  94/**
  95 umberatellogot_fs2ify ning: Incced a nsheck flag
  96 * @nilfs: nilfs object
 137
 138 * @bhs: buffer h-mmary er root block
 139  ror in  -mmary /* wor.net>
 140 */
 104static int the_nilfs *nilfs, u64 ,
  72                46        struct buffer_head *block,
 143                      ock(struct  **)
 144{
 115rt, unsigned long nbh_sr;
 116        u32 crc;
 117        int ret;
  58
  39        pbh = NILFS_SEG_FAIL_M>ret;
 120    a>, int __bread(bh->!pbh = NIL_CEG_FAIL_MAGIC" class="sref">NIL_CEG_FAref"heck)
  71        gopoih = ret;
 112
 123        pbh = NILFS_SEG_FAIL>ret;
 124    a>, int __bread(bh->!pbh = )
 125        gopoih = ret;
133}
 147        nblpbh = __bread(bh-> > 0);
  38        pbh = NILFS_SEG_FAIL_CONSIST > 0);
  69    a>, int __br        nblp= 0 ||u/a>->nblock = nilfs->n_nilf"s_warnlock>heck)
 120        ;    */
  71        gopoih = ret;
 112
 123        pbh = NILFS_SEG_FAI > 0);
 124    a>, int nilfs_compute_checkfs *nilfs, bl &->cns_bofread(bh->lock,
 105                           (in_t(nblolt;olt;ze = nilfs->ns_b_bitslock>lock,
 106                          lfs, b">bh->ck_blze = nblheck)
  67        gopoih = ret;
  58
  39        pbh = NILFS_SEG_FAIL_CHECKSUM_>ret;
 120    a>, int !pbh = __bread(bh->heck)
  71        gopoih = ret;
  39        pb return 0;
int :
 124       ad *ret;
  92}
133}
 137/**
 138nil -mmary_infoot_block8
 139 * @nilfs: nilfs object
 140 ytescurr in * @bhs: buffe eh-mmary er ro: [in, =us]s object
 101 * @ytescurr in *yte@offset:e eh-mmary er ro: [in, =us]s object
 102_object
 103 */
 104 *nil -mmary_infochecksum" class="sref">nil -mmary_infoot_block(struct the_nilfs *ni/
 105                                     struct buffer_head **/
 106                          la>        unsigad **offs        unsigned int check_bheck)
 144{
 118voidilfs *ret;
  39        sector_t ck_b>ret;
> 0);
 111        BUG(ad **bh->solt;zad **of> > 0);
  52            check_byock **bh->s-zad **of> > 0) {
  63        r_t ck_b>sulad **bh->ck_b > 0);
  64        /a>->bread **  65                *pbh = __bread(nilfs->ns_bdr_t ck_b>+ 1>/
 106                       /a>->nilfs->ns_block> > 0);
  67                    __br ad **)
  68                       ad *NULL;
  69        ad **of>pb return 0;
 130        }
 111        sulad **bh->b_datad **ofreturn 0;
  72ad **of>+pbh = check_breturn 0;
  73       ad *ret;
 133}
133}
 136/**
 137
 138 * @nilfs: nilfs object
 139 ytescurr in * @bhs: buffe eh-mmary er ro: [in, =us]s object
 140 * @ytescurr in *yte@offset:e eh-mmary er ro: [in, =us]s object
 101 102 103 */
 104 *the_nilfs *ni/
 105                                    struct buffer_head **/
 106                          la        unsigad **offs        unsigned int check_b>/
 107                          a>rt, unsigned long )
 108{
 109        unsigned int 133}
 120        sul(ad **bh->s-zad **of> /bh = check_breturn 0;
 121
  52             = > > 0) {
  63        ad **of>+pbh = check_bomm         124} sref > 0) {
 105                sector_t ck_b>sulad **bh->ck_b > 0);
 106                unsigned int bh->s/bh = check_breturn 0;
 107                unsigned int   58
  69                 -= return 0;
 120        ned int pbh = __bread( =   71        ad **of>pbh = check_bomm         - 1)omm         112
  63        r_t bread **  64                *pbh = __bread(nilfs->ns_bdr_t ck_b>+         /
 105                       /a>->nilfs->ns_block> > 0);
 106 133}
 133}
  58
 139/**
 140/**
 101 * @nilfs: nilfs object
 102:: DBN of stask block numbernsheck flag
 103 nsh h-mmary informationeck flag
  94ilfs2/per_roo/* wor.net>
  95 */
 104static int the_nilfs *nilfs, sector_t sector_t" class="sre_"sref">ck_block,
 107                        ock(struct  **,
  68                        ock(struct  **)
> 0) {
 120        struct buffer_head *  71        unsigned int ofreturn 0;
  39        u32 , ofreturn 0;
 123        sector_t ck_b>ret;
 124r_t  ret;
 125nsigned int pb-ned int 133}
 147         = __bread(bh-> > 0);
  38        if (!)
  69                return 0;
> 0);
 111        oflpbh = __bread(bh-> > 0);
  39        ck_b>sur_t sector_t" class="sre_"sref">ck_b>+         __bread(oflze = nilfs->ns_block> > 0);
 123        pbh = __bread(nilfs->ns_bdr_t sector_t" class="sre_"sref">ck_blze = nilfs->ns_block> > 0);
 124    a>, int __br         )
 105        gopoih = ret;
133}
 147        of>pbh = __bread(bh-> > 0);
  38for (;;> > 0) {
  69        rt, unsigned long  = ret;
 120        ock(struct ret;
 121
  72        ad *pbh = nil -mmary_infochecksum" class="sref">nil -mmary_infoot_blfs *nil&->->off 121
 143                                        ns_bofread * > 0);
  64            a>, int __br         > 0);
 105                gopoih = ret;
133}
 107        r_t pbh = __bread(bh-> > 0);
  68        ed long __bread(bh->  69                 = __bread(bh-> > 0);
 120        ned int pbh =  121
  72        while  a>, int  > 0) {
 143                ock(struct ilfs2/per_rochecksum" class="sref">ilfs2/per_rofer_head * 124                ock(struct ret;
133}
 106                ad *pbh = nil -mmary_infochecksum" class="sref">nil -mmary_infoot_blfs *nil&->->off 121
 107                          a>                os_bofread * > 0);
  68                    a>, int __br         > 0);
  69                        gopoih = ret;
> 0);
  71                ad *pbh = __bros_bofread * =  > 0);
  72                    a>, int __br          > 0) {
  63                        ad *pb-ned int ret;
  64                        gopoih = ret;
  65                 133}
 106                        bh->pbh = ret;
  67                        bh->ck_b>sur_t ck_b++>ret;
  68                        bh->ck_b>sur_t __bread(bh-> > 0);
  69                        bh->sur_t __bread(bh-> > 0);
 120                 /a>;   bh */
  71                ad *__br&->bh-> =   72         133}
  63            --ned int > 0);
  64                srefk > 0);
 105                ck_b>+pbh =   /a>;    */
 106        h = nil&->->offcns_bofread(
 107                          a>h =   68            a>, int __br         )
  69                gopoih = ret;
 130        }
 111        pb return 0;
u32 :
 123        bre        ;    */
 124       ad *  92}
133}
 104 *ilfs2/plistck_bytes" classdisposef">ilfs2/plist>__brock(struct  **)
 108{
 109while           bre         > 0) {
 120        ock(struct ilfs2/per_rochecksum" class="sref">ilfs2/per_rofer_head * 121
  72        ad *pbh = bre        (struct ilfs2/per_rochecksum" class="sref">ilfs2/per_rofer_lze =   63        h = __br&->bh->  64        h = bre         105  92}
  92}
 92}
ock(struct  > 0) {
  69ock(struct  =  120ead(  69           ead(} > 0);
 112
 104static int  ** =  ead()
> 0) {
 105ock(struct  ed **pbh = __bros_bofread * =  > 0);
133}
 107    a>, int __br         )
  68               -ned int ret;
ret;
 120ead(bh->sur_t  111        __br&->bh->  39        __br&->bh-> =   73        return 0;
 133}
133}
voidifs * **)
 144{
  68while           bre         > 0) {
  69        ock(struct  ed **> 0);
  71        d **pbh = bre        (struct lze =   72        ad *__br&->bh->  63        h = bre         124 133}
  92}
133}
 104static int ilfs2/per_root" class="+codpreparefes_warn_forf">ilfs2/>__brock(struct the_nilfs *ni/
  68                        69        ock(struct  *ni/
  69                        69        ock(struct ilfs2/pinfochecksum" class="sref">ilfs2/pinfofer_head *)
> 0) {
 111ock(struct  **pb&->bh->  39ock(struct  ed ** * 123ock(struct  *pbh = nilfs-> 124e =  ead( 105nsigned int  105nsigned int  92}
  38ead(pbh = nilfs->  69ead(pbh = nilfs-> 120ead(pbh = bh-> 111        pbh = bh-> 112
 143 /a>;    */
  94 */
  95 */
 136 */
 147        pb(struct bre        ,   38    a>, int __br        )
  69        gopoih = > 0);
 111for (ned int pb1;gned int  > 0) {
  72                pb(struct ,  143            a>, int __br        )
 124                gopoih =  105  92}
133}
 107 /a>;    */
  95 */
 139 */
 140 */
 111        bre         =  =  =   72            a>, int bh->!sur_t   63                        pb(struct bre        , bh->  64                    a>, int __br        )
  65                        gopoih =  106          92}
  67        ad *__br&->bh->  68        h = bre          69  92}
> 0);
  71 /a>;    */
  39        pb(struct bre        ->  63    a>, int __br        )
  64        gopoih = 133}
 106h = nilfs->pb return 0;
 147        nilfs->pb(struct bh->+ 2return 0;
  38ead(nilfs->pbh = nilfs->sur_t ret;
 h = :
  71 /a>;    */
  39       ad *  92}
 92}
 104static int ilfs2/pcop/per_rochecksum" class="sref">ilfs2/pcop/per_ro>__brock(struct the_nilfs *ni/
 106                             ock(struct ilfs2/per_rochecksum" class="sref">ilfs2/per_rofer_head *
 107                          a>(struct  *)
 108{
  69ock(struct buffer_head * 120voidiead * 121
  39        pbh = __bread(nilfs->ns_bdr_t bh->ck_blze = nilfs->ns_block> > 0);
  63    a>, int __br         )
  64               -ned int 133}
 106h = pbh = __bread( 147        __bread(+         __bread( = bh-> = bh->  38ead(__bread(  69ead(bre         120        return 0;
}eturn 0;
 112
 104static int __brock(struct the_nilfs *ni/
  64                        69ock(struct  *ni/
  65                        69ock(struct 
 106                             >ock(struct  **
 107                          a>, unsignlfs *)
 108{
  69ock(struct  * 120ock(struct ilfs2/per_rochecksum" class="sref">ilfs2/per_rofer_head * * 111rt, u/a>->ns_block>pbh = nilfs->ns_blockreturn 0;
  39ock(struct  *  73(struct  h =   64nsigned int pb ilfs, pb return 0;
133}
 106h = bre         * =  =  107        r_t bre        nidr_t  bh->  68            a>, int bre         > 0) {
  69                r_t pb(struct bre         120                 _t   71                gopoih =   72        }eturn 0;
eturn 0;
  64        h = pb(struct bh->olt;olt;  _t bh-> 105                pb(struct _write_begi=per_root" classref">_write_begi=">bre        bh->  = ns_blocki/
 106                             > b il&-> =  107            a>, int __br          68                (struct  h = pbh = bh->  69                    a>, int +         ns_block>>bh< h = )
 120                        (struct bre         =   71                gopoih =   72        }eturn 0;
eturn 0;
  64        h = pb(struct ilfs2/pcop/per_rochecksum" class="sref">ilfs2/pcop/per_ro>__brfs *nib(struct   105            a>, int __br        )
 106                gopoih =  92}
  68        h = pb(struct bre          69            a>, int __br        )
 120                gopoih =  121
  72                _write_enffer_head" class=ef">_write_enf>__br        bh->  = ns_blocki/
  63                                ns_blocksize" class=ef">ns_blockidr_t   92}
 105                _pageot_block" class=nlf">_page>__br         106        h = leaseot_block" classpage_cachef">lease>__br         92}
  68        read *  69        gopoih = > 0);
 h = :
  72                _pageot_block" class=nlf">_page>__br         143        h = leaseot_block" classpage_cachef">lease>__br         92}
 h = :
 106        h = __br         92}
 107                /a>;   "NILFS warning: ereor /nilfs2ingusref "+cod "ent"> */
  68                /a>;   "(ere=%d, ino=%lu, "+cod-o"+cod=%llu)\n"ent"> *i/
  69                       , unsig)r_t bh->
 120               (rt, unsigunsig)r_t bh->  71                     )
  72                        pb         h = :
  64        /a>->bre         /a>;   just /a>or, u*ment"> */
  65        (struct bre&->bh-> 106        /a>->bre          67}eturn 0;
  68       ad *}eturn 0;
> 0);
 /a>;    */
 140 */
 140 */
  94 */
  95 */
 136ilfs2/pinfofet"> */
 136 */
 104static int breock(struct the_nilfs *ni/
  69                        6ock(struct  *ni/
 120                        >ock(struct 
  71                        >ock(struct ilfs2/pinfofer_head *)
> 0) {
 123ock(struct buffer_head *pb         123ock(struct  *  65fs * h =  106h =  h = ,  /a>;    */
 107rt, unsigu(struct pb return 0;
 107rt, u>static int   69ead( ead( 120ead( ead( = pb return 0;
  71nsigned int pb return 0;
  39nsigned int pb ilfs,   73(struct bre        __b)ra> /a>;    */
  64en"+ > 0) {
  65        (struct 
 106        /a>-> /a>;    */
 147}return 0;
  38nsigned int pb        ret;
 120ead(pb(struct bh-> 111        pb(struct bh->  39        pb(struct bre        nib(struct   73(struct bre        nib(struct ->-> 92}
  65while e        !sur_t bh->ead(olt;sur_t bh-> 106        ad *bre         107        ad *pb        ad_log">bufee=blocknr" class="sref">ad_log">bufee">bre        nib(struct ->  68                       69                r_t pb-ned int  120                gopoih =   71        }eturn 0;
 112
 143        h = pb        bre        nib(struct  =   64            h =   65                    h =  106                        r_t pb-ned int  107                        gopoih =   68                }eturn 0;
  69                gopoih =  120        }eturn 0;
 121
  72        tic int pb        bre        bh-> 143            a>, int &)
  64                gopoih = 133}
 106         /a>;    */
 107        e = pb(struct bre        ni/
  68                                                    bre        bh->  69        ned int pb return 0;
 120                nilfs->pb        bre        bh->  71              a>, int &  72                        nilfs->pb(struct nilfs->eturn 0;
  64        switch e         105        caseb        :
 106                      a>, int &:
 107                      a>, int &  68                        gopoih =   69                        pb         120                 /a>;    */
  71        caseb        :
  72                      a>, int &  63                        gopoih =  92}
 105                        pb(struct bre        nib(struct 
 106                                           &->__b)r/
 107                    a>, int __br        )
  68                        gopoih =   69                    a>, int & 120                        (struct pb(struct ilfs2_dsync_"+codode=nilfs" class="+cod/nilfs2_dsync_"+codo>__brgt; 0) {
  71                        >       (struct nib(struct nidr_t ->__bi/
  72                                &->
 143                            a>, int __br        )
  64                        69  gopoih =   65                                pb         106                }eturn 0;
 107                srefk > /a>;    */
  68        }eturn 0;
ret;
 h = :
  71            (struct bh->)
  72                srefk eck)
 143        h = bre        bh->
  64            (struct  
  65                continuer/
 106        gopoih =  92}
 h = :
  69            a>, int bh->)
 120                srefk eck)
 121
ih = :
 143        h/a>;    */
  64            (struct )
  65                srefk eck)
 106        ad * 107        e = pb(struct   68        h = bre        nib(struct ->->  69        a>, int  =  120}eturn 0;
 121
  39n   (struct  143        h = __br        ih/a>;   "NILFS (device %s): salvaged %lu "+cods\n"ent"> *i/
  64               (struct n">bh->nib(struct 
  65        (struct bh-> =  106}eturn 0;
 h = :
 107h = bre          69ead(ilfs2/plistck_bytes" classdisposef">ilfs2/plist">bre&->__b)r/
 120       ad *
 121
ih = :
  73(struct pb-ned int 
 ead(:
  65fs *__br         121
 106       h/a>;   "NILFS (device %s): Ereor /oll-forwardingu"ent"> */
 107        /a>;   "(ere=%d, p=s_ "+cod=%llu). "ent"> *i/
  68       (struct n">bh->nib(struct , unsigunsig)r_t   69gopoih = }eturn 0;
 121
 104 = the_nilfs *ni/
 143                              ock(struct ilfs2/pinfofer_head *)
> 0) {
  65ock(struct buffer_head * 106nsigned int  92}
  68n   (struct bre        nib(struct bh->}
  69    (struct bre        nib(struct bh->)
 120               > 0);
 121
  39        bre        nilfs->nib(struct bh->nilfs->ns_blocksize" class="+bef">ns_bref") > 0);
  73(struct bre           64        bre        bh->, bh->  65fs *bre         106h = pb(struct bre         107    a>, int __br        )
  68        fs *__br         92}
  69                /a>;   "NILFS warning: ="sref syncuwrite failef duringu"ent"> */
 120                /a>;   "post-cleaninguof /nilfs2/.\n"ent"> *) > 0);
 111        bre        }eturn 0;
eturn 0;
  94 */
  95 */
 136 */
 136 */
 136ilfs2/pinfo>ockto>ocore search /nsults.ent"> */
 136 */
 136 */
 /a>;    */
 /a>;   }eturn 0;
eturn 0;
bre        bre      atest che classRF_INIT_STfer_ROOT7/a>:
73"L76" class="line"5 name57136urn 0;
bre      span clasde=nilfs" classflagoref"7&<73 */
bre      
 707bre      fo>ock  68<7a>   73/

bre      ass="co*e    bre      erfollowi"> 120              7  /a>73lfs2/reco7ery.c#L127" id="L13e66eco6vRESTARTSYS#L667e"7rupt>eturn 0;
bre     STde=nilf7" classRF_DSYNC_STlockRO7T74ed.ent"> */
bre     Sd="L87" ngode=nilfs" classflagore7">&am74/nilfs2/reco7ery.c#L107" id="L66eco6vNOMEM#L667s2/riciL65"memor_rov idabl1turn 0;
bre     43" class7"line"6name=64L63">  63<7a>   74efp
ipan class="co* =egative   65                srefk eck)
<7reco6ery.7#L116" id="L145" class="7ine"67ame=64lass="line"5 name57L69"> ry.c#L117" id="L127="L110" class="line"7ry.c#L117" id="L127 ilfs2/pinfofer_head *)
bre        7a hre74s 104dref">pb        
  65ock(struct buffer_head * 106L68">  687/a>                     7  gop7ih = ilfs2/pinfochecksum" class="sref">ilfs2/pinfofer_head *)
 94 */bre         1207/a>  74    (struct   71 refere=blocknr" clas" id="L113" class="line"7name=71L73">  73(struct /rec0=60106"> 106   id="L71" class="line"6 name67121"> 121
7_bi/<7span>
bre            7                       a7, int75" class="sref">nib(struct   64             7     75 href="fs/nilfs2/reco6vry.c#L1465" id="L95" class="line"lfs2/pinfochecksum" cattach_class="co*="sref">ilfs2/pinfofeattach_class="co*c#L107" id="L124" cl          &-> 121
ock(st)
  94 */pb      92}
 106        7     7 }eturn 0;
 */
 107       7"> */
 *) > 0);
}eturn 0;
:
:
  95 class="l7ne"6 name66L71">  717     7     (struct  111       L1465" id="L95" class="line"lfs2/pinfochecksum" cdo> 143                         do> 143    >               > 0);
buffer_head * 92}
bre          65             7  con76s 104dref">pb      106}eturn 0;
 h = :
               > 0);
buffer_head * h =  92}
  69            7>, in76id="L59" class="line"6 name65rning: ="sref syncuwrite failef duringu"ent"> */
 *) > 0);
pb     /a>lass="line"7name=72111"> 111         *) > 0);
<7" id="L122" class="line"7name=72L72">}eturn 0;
:
125" class="line"7name=72L95">  95lass="lin7"6 name67143"> 143  7     7/a>;    */  6c#L128" class="line"6name=6attach_>  6c#L128c#L107" id="L124" cl          &->)
  94 */)
 92}
 107      7ass=s_n"+7ock>pb(struct  9
 9
>               > 0);
 */ = 1464" id="L74" class="lsum" c" idcod/>1464" idc#L107" id="L124" cl          &->  94 */->  6c#L128" class="line"6name=6detach_>  6c#L128c#L107" id="L124" cl          &->  94 */}eturn 0;
:
      92}

 */
 *) > 0);
 111        __br      7 nib(struct  */ *i7
 125" class="line"7name=72L95">  95ECOVERY_R7LLFORWARD_DONEref" > 7);
 107      7e"6 name67807"> 107h =  143                              ock(struct buffer_head *  95E0rtref" 7disposef">ilfs2/plistck_7ytes"7classd25" class="line"7name=72L95">  95E"fs/nilf7lass="line"6 name69120">7120      assRF_INIT_STfer_return 0;
 106  7="line"6 7ame69239">ih =  111       sum" cputclass="sref">ilfs2/pinfofeputclass )
  94 */  73(struct 
:
  95ailefde=n7lfs" classfailefref"ROOT7/a>:
79logs - salvageunsgsuwritten aftil mberefKERN_ER7sector_t" classKERN_ERR27"> 1279fs/nilfs2/reco7ery.c#L117" id="L126" class="line"7name=72136"> 136    h/a>;7  "NIL7S (de79 */
126" class="line"7name=72136"> 136 "6 name67anstringf>"(ere=%d, p79L128" class="line"7name=72L68"> 136 136 +code=su7cksum" classsbf">n">bh->79/
 136bre     "line"7na7e=70121"> 121
l6
ass="urn 0;
bre    8nish_roll8forwardchecksum" class="8reffi80ed.ent"> */
bre    8n1sh_roll8fL73">  73(struct  136lcpu">bre urn 0;
bre    8n2sh_roll8fr_root" classEENVArref"8reco780efp
ipan class="co* =egative ereor  hrekis> 6 name688ilfe           8#L107"" i8="L94" class="line"7name87012480&-> /a>;   eturn 0;
bre    8nsign8d int 
bre    8<6a>nsign8dnstringf>"(ere=&t bre    8<7a>nsign8dksum" classsbf">n">bh
bre    8<8a>nsign8d__ 10rtref") > 0);
<8i_l=s802/reco7ery.c#L137" id="L130" c66eco6veO#L66/Oss="liurn 0;
bre    8 hrefri_s8nilfrootper_root" class/8_suni80lfs2/reco7ery.c#L127" id="L131" class="line"7name=73L71"> /a>;    */
bre    8"+code=ni8fs" class="sref">nilfs->81/nilfs2/reco7ery.c#L107" id="  65                srefk eck)
<8nib(struc8 bh r Valu" id="L112"="sref">ilfs2/pinfofer Valu" id="L112" ilfs2/pinfofer_head *)
br8     81> 0) {
  65ock(struct buffer_head * 108106h<8a> =  92}dsync_"+codo>__b)r/
 * 107   od/ootper_root" class=ne"7na"fs/nilfpanma"fs/nilfs2/reco6vsum" c"fs/nilfpanma"fe"7name=70107"> 92 __b)r/

bre          698/a>                /a>; 8 ilfs2/plist">brecR  _" id="L82" class="cR  _"     assRF_INIT_STfe" = h = brecR  _" id="L82" class="cR  _"     assRF_INIT_STfe         &bre  8     8a href="code=sry.c#L107" id=er_root" class=n/ref" = h = pb(struct )
<8=ib(struc8ref="fs/nilfs2/reco7ery.8#L11782>bh->  65assKERN6/a>
)
<8=efmemsod8class="co* ="srefealvage8orpha82 href="fs/nilfs2/reco6vry.c#__u5">  65assKER__u5"a>
nib(struct bre         */
<8 href82) > 0);
  65assKER__u5"a>
bre        h<8s="co* @ref=": ="sre obj8ctent82eref">pb(struct pb    t )
  94 */<8>
 *bre        nsign8>to>ocore search /nsults8ent">827f="+codgodp=s_n"+_ofper_rocheckrco7ery.c#L107" idre/a>)
 94 */<8lass="co*8nt"> */
  98berfollow8ngent"> */
bs="line"6 name68121"> 121
 */<8n class="8o* =egative ereor  hreki8>    836name=60111"> 111       ref="fs/nilfs2/reco6vry.c#L1468" fs/nilfs2/reco6verfrichecksum" classrifer_heck)
 94 */<8n+code=ni8ame=72L72">}eturn 0;
eturn 0;
ock(stcn6>fs/nilfs2/reco6verfrichecksum" classrifer_heck */<8nib(struc8e"+code=sum" 1 0);
(stru8t bh->bre         120               > 0);
}eturn 0;
:
83) > 0);
;
  65                srefk eck)
<8 span cla8de=nilfs" classflagoref"8&<83eref">pb(struct   69        a>, int  =  807nsign8"line"6name=63L68">  68<8a>   837 > 0);
;
  65                srefk eck)
<8 ass="co*8    ilfs2/plist">br        &  39n   (struct  120              8  /a>83t;post-cleaniwhile   s/nilfs2/reco6very.c#ih = 84es_warnfer_ROOT:
 href="fs/nilfs__    day.c#L107"" id="L97"__    day.c#co6vry.c#L1369" id="L79" class="line"6 name67L69"ize" class="+bef">ns_bref") > 0);
  64        &am84a>;     63<8a>   84>bh->l(;;0;s): salvaged %lu "+cods\n&quo8reco6ery.8#L116" id="L145" class="8ine"684vry.c#L1464" id="L84" class="line"6 re&->__b)r/
bre        8a hre84s 104dref">pb        +_ofper_rocheckrco7ery.c#L107" idre/a>)
 class="line"6 name68107SEG_FAIL_Iksum" classsbf">e68107SEG_FAIL_Ikname68239">  39n   (struct  92}dsync_"+codo>__b)r/
  6y.c#28" class="line"6name=6a ad_>  6y.c#28>               > 0);
}eturn 0;
 , in8  h = __b)r/
nsign8/a>                     8  gop84id="L59" class="line"6 name65s" classRF_INIT_STfer_return 0;
  98150" clas8="line"6name=65120"> 1208/a>  84lfs2/reco6very.c#L861" id="L81" clasrco7ery.c#L107" idre/a>)
 class="line"6 namname=6ksum"  " class="line"6name=6ksum"  co6vry.c#L1369" id="L79" class="line"6 name67L69">  69        a>,="fs/nilfs2/reco6vry.c#L1468" ">bre        __b)r/
  69        a;  _t :
     )
0;s): salvaged %lu "+cods\n&quo8"+codode=8ilfs" classdsync_"+codo>8_bi/<8span>
)
 cclass="line"6 name68107SEG_FAIL_Iksum" classsbf">e68107SEG_FAIL_Ikname ref="fs/nilfs2/reco6very.c#L960"83    8                       a8, int85nilfs2/reco6ery.c#L10fs/nilfs2/reco65s" classRF_INIT_STfer_return 0;
  64             8     85vry.c#L1464" id="L84"""""""""s" classRF_INIT_STfestray9
pb        125" class="line"7name=72L95">  98line"6 na8e65106"> 106        8     85ass="line"6name=62107"> 107      8"> */
 =  =    69gopoih = nsign8ef="fs/nilfs2/reco6ery.c8L11698 id="L59" class="line"n>
 121
 = -      92}
 /nilfs2/reco6very.c#ih =   718     85ss="line"6 name67120" hrefe"++_ofper_rocheckrco7ery.c#L107" idre/a>)
 class="line"6 name68107SEG_FAIL_CONSISTENCYsum" classsbf">e68107SEG_FAIL_CONSISTENCYfs2/reco6ery.c#L1166" id="L56" class=8 classp=s8_ 10rtref" =pb        
  98refle32_t8_cpude=nilfs" classle32_8o_cpu86" class="sref">nib(struct ;

ass="mme67L65">  65                srefk eck)
<86 name6"L85">  65             8  con86s 104dref">pb        +_ofper_rocheckrL86" class="line"6 name68106"> 106}eturn s="line"6 name68121"> 121rn s="line"6 o6ve class="line"6 nams="line"6 name68121"> 121
 121
)
<8=> */ h =        111" class="line"7name=71121"> 121
)
<8=7a>nsign869">  69            8>, in86id="L59" class="line"er_root" class=nss="sref">nib(struct  120               > 0);
 =    69gopoih = )
<8=50" clas82/reco6very.c#L760" id="870" c8ass="line"6 name67120" 111       111" class="line"7name=71121"> 121
nib(struct refnss="sres_n cl+code=nilfs" class="sref">nib(struct )
<8 = :
+_ofper_rochecks  ad *)
<8 "fs/nilf8"6 name67143"> 143  8     8/a>;    */pb(struct  =    69gopoihpb(struas_class_enf href="fs/nilfs2/reco6very.c#L960"8efemptyde8_=blocknr" classemptydes8ref"+8heck)
pb(struct ;
                srefk eck)
<8 n 0;
5                srefk eck)
<8 > */pb(struct   65                srefk eck)
<8e6 name668    h = )
 class="line"6 name68107SEG_FAIL_CONSISTENCYsum" classsbf">e68107SEG_FAIL_CONSISTENCYfs2/reco6ery.c#L1166" id="L56" class=8e0rtref" 8 href=s__ 10rtck_bytes" 8lass=8__ 10rtref", &---------s" classRF_INIT_STfer_return 0;
}eturn 0;
  98=salvaged8"+codode=nilfs" class=sa8vaged88es_wa25" class="line"7name=72L95">  98="fs/nilf8 id="L83" class="line"6 8ame6888pan>
 121
__br      8   69        ass="sref">nib(struct  *i8
s/nilfs2/reco6ver);
 ry.c#L10fs/nilfsct ns_bref") > 0);
  64         107h =   98=6 name668" class="_s"+ref") > 8);
pb(struct ilfs2/plistck_8ytes"88_ 10rtref", &---------    e=sum" class=_srs" id="L113" class="line"7name=71L73">  73(struct /lass=lass=l07" id="L124" clclassereref">pb(struct ->)
00;s): salvaged %lu "+cods\n&quo8t"fs/nilf8lass="line"6 name69120">8120  73(struct /rlass="line"6 nams="line"6 name68121"> 121
ih =   73(struct )
<8ne"6 name89L73">  73(struct 
  98refEENVAr8er_root" classEENVArref"8/pb(struct :
89> 0) {
  73(strucfs/nilfs2/reco6very.c#L662" id="L7/rlass="line"6 nams="line"6 name68121"> 121
 1289" class="line"6 name6 hrefe"+s" classRF_INIT_STfetryfnss=>"NIL8S (de89ref",           98r"6 name68anstringf>"(ere=&d, p89L128"reco7e1y.c#L107"" id="L91" class8 +code=su8cksum" classsbf">n">bh->89id="L59" class="line"e;
  65                srefk eck)
<8s" classp8s__ 10rtref") > 0);
<8 href89_ 10rtref", &-> 121
ock(stock(stcn6>++reco6ery.c#L1166" id="L56" class=8="fs/nilf8e=70121"> 121
       111" class="line"7name=71121"> 121
ilfs2/pref id="L112"="L7/rlass="line"6 nams="li);
  73(struct /rlass="line"6 nams" id="L113" class="line"7name=71L73">  73(strucfs/nilfs2/reco6very.c#L662" id="L7/rl6r                srefk eck)
<9n1sh_roll9fL73">  73(struct ;   ilfs2/pinfofedispose="fs/nilflis"co6vrlass=s__ 10rtref" > b    t )
  94 */<9#L107"" i9="L94" class="line"7name97012490vry.c#L1464" id="L84" class="line"6  r_dode=nilfs" classdsync_"+ r_dode=nilfs>
 121
pb        +_ofper_rocheckline"ode=sum" class="fer_) > 0);

offsco>
 121
 = "NIL9 clas90 id="L67" class="line 111       line"ode=sum" class="fer_) > 0);
)
<9<6a>nsign9dnstringf>"(ere='t nib(struct )
<9<7a>nsign9dksum" classsbf">n">bhock(stilfcn6>/rlass="line"6 namcn65ock(stcn6>;e"e;
  65                srefk eck)
<9<8a>nsign9d__ 10rtref") > 0);
<9i_l=s90_ 10rtref", &-> =    69gopoih */<9#9a>nsign9d=70121"> 121
       enffeode=sum" class="fer_) > 0);
nib(struct nib(struct )
<9     99"+code=ni9fs" class="sref">nilfs->91pan>
  99"2sh_roll9  106}eturn 0;
:
br9     91> 0) {
  99"50);
 =  )
<9 6a>nsign9d="L117" class="line"7na9e=71191#L1468" id="L58" class="linecassRF_INIT_STfe"06nsign9> *  99L69">  699/a>                /a>; 9   99nhrefri_s9        /a>;   &q91      assRF_INIT_STfetryfnss=> 106  9="+code=b9else" class="sref">bre  9     92es_warnfer_ROOT:
+;
  65                srefk eck)
<9=+code=ni9co7ery.c#L107" id="L123"9class92pan>
 121
 =  121
/nilfs2/reco6very.c#ih =  9r                srefk eck)
<9=gt; */
<9 href92" class="line"6 name6s" classRF_INIT_STferc#L6s64" id="L74" class="lrc#L6s64" idnilfr                srefk eck)
<9=50);
 107      9>
 106  9=7a>nsign9>to>ocore search /nsults9ent">92id="L59" class="line"e;
  65                srefk eck)
<9=69">  699nt"> */
-    e=sum" class=_sr"06)
<9=hrefri_s9ngent"> */
;
    93ed.ent"> */
126" class="line"7name=72136"> 136}eturn 0;
bre    9nib(struc9e"+code=sum" 1 0);
(stru9t                 srefk eck)
<9  &:
93) >eco6ery.c#L1166" id="L56" class=9 50);
assRF_INIT_STferc#L6s64" id="L74" class="lrc#L6s64" idnilfass="line"6 name69106"> 106  9 
 907;
                srefk eck)
<9 7a>nsign9"line"6name=63L68">  68<9a>   93warn_rangeot_block" c    assRF_INIT_STfes  ad *)
<9 ass="co*9    ---------s" classRF_INIT_STfesid="L112"_f_roc _t ;
                srefk eck)
<9 hrefri_s9"> 120              9  /a>93    (struct 94es_warnfer_ROOT:
 href="fs/nilfsrco7ery.c#L107" idre/a>)
 class="line"6 namname=6"fs/nilflis"_ad                      "fs/nilflis"_ad co6vrlass=s__ 10rtref" > b    t )
>  69        a>, int  */<9Sd="L87" 9gode=nilfs" classflagore9">&am94pan>
 92}
)
00                srefk eck)
<943" class9"line"6name=64L63">  63<9a>   94nilfs2/reco6ery.c#L10fs/nilfss" classRF_INIT_STfer_return 0;
bre        9a hre94s 104dref">pb        +_ofper_rochecky.c#Lfs/nilfs2/reco6vry.c#L1468" ++reco6ery.c#L1166" id="L56" class=9 92bre        nib(struct )
<9s
, in9  h =   69        a>, int  = nsign9/a>                     9  gop94id="L59" class="line"  121
  39n   (struct   99150" clas9="line"6name=65120"> 1209/a>  94    (struct   106  9"+codode=9ilfs" classdsync_"+codo>9_bi/<9span>
                srefk eck)
<93    9                       a9, int95>bh->->__b)r/
  64             9     95vry.c#L1464" ass="line"6 namlis"_splice_ts/n= h = )
> lass=s__ 10rtref" &g"L86" class="line"6 name68106"> 106}eturn us#L6s64" id t 
pb )
fs/nilfs2/reco6veryr_dode=nilfs" classdsync_"+ r_dode=nilfs>
 106        9     95eref">pb(struct )
fs/nilfs2/reco6verfrichecksum" classrifer_heck
ock(stilfsum-&cn6a>)
/rlass="line"6 nams" id="L113" class="line"7name=71L73">  73cn65ock(stnsign9ef="fs/nilfs2/reco6ery.c9L11699 id="L59" claslasscon6r                srefk eck)
<9rnt   99"50" clas9ne"6 name66L71">  719     95      assRF_INIT_STfer_return 0;
 106  9 classp=s9_ 10rtref" =pb         111       re&->__b)r/
eturn 0;
<;
ilfs2/pinfofedispose="fs/nilflis"co6vrlass=s__ 10rtref" > b    t )
  94 */<9refle32_t9_cpude=nilfs" classle32_9o_cpu962d="L59" claslasscon  )
 06">/0) ?
 href="fs/nilfsrco7ery.c#L107" idre/a>)
 :2L63">eturn 0;
<;
ilfs2/pinfofewarn="fs/nilfs="liG24"> 92}
)
0 94 */<9r name65L9lfs" class=s_n"+codofer_9r/  996 name6"L95">  65             9  con96s 104


f12"er"> T=73original LXR software byl6LXR f="funitya>) > this exd="i/nilal L95sion byl5" class=ms/nto:lxr@ ux.n65>lxr@ ux.n6a>) .
subf12"er"> lxr. ux.n6 kindly hose"d byl5" class=http://www.redpill- pro.n65>Redpill L pro ASa>) > provider7namL ux/610On eclasand od="atc10O serviceO since 19e/a>) 0 94) :2L63">eturn 0; <;