Changeset 2817


Ignore:
Timestamp:
Jan 11, 2012, 9:36:50 AM (2 years ago)
Author:
wmb
Message:

EXT2/3/4 filesystem - OLPC trac #11184 - fixed another problem with journal recovery (corruption when blocks revoked) and enabled writing by accepting more flag values.

Location:
ofw/fs/ext2fs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ofw/fs/ext2fs/dir.fth

    r2799 r2817  
    7676; 
    7777 
    78 : +link-count  ( increment -- )  link-count + link-count!  ; 
     78: +link-count  ( increment -- ) 
     79   \ link-count = 1 means that the directory has more links than can 
     80   \ be represented in a 16-bit number 
     81   link-count 1 =  if  drop exit  then  \ Don't increment if already 1 
     82 
     83   \ If the incremented value exceeds the limit, store 1 
     84   \ We should also set the RO_COMPAT_DIR_NLINK bit in the superblock, 
     85   \ but we assume that OFW won't really be used to create enormous directories 
     86   link-count +  dup d# 65000 >=  if  drop 1  then  ( link-count ) 
     87 
     88   link-count! 
     89; 
    7990 
    8091: new-inode    ( mode -- inode# ) 
  • ofw/fs/ext2fs/recovery.fth

    r2798 r2817  
    278278   2dup revoked?  if                   ( d.block# ) 
    279279      2drop                            ( ) 
     280      log-block++ drop                 ( ) 
    280281   else                                ( d.block# ) 
    281282      tagp >t_flags be-l@ 1 and        ( d.block# escaped? ) 
     
    412413 
    413414." Recovering from journal ... " 
    414  
    415    0 ['] one-pass catch  if 
     415   0 to end-transaction 
     416 
     417   0 ['] one-pass catch  ?dup  if 
     418      .error 
    416419      ." Journal scan failed" cr 
    417420      free-journal exit 
    418421   then 
    419422 
    420    1 ['] one-pass catch  if 
     423   1 ['] one-pass catch  ?dup  if 
     424      .error 
    421425      ." Journal revoke failed" cr 
    422426      free-revoke-list  free-journal  exit 
    423427   then 
    424428 
    425    2 ['] one-pass catch  if 
     429   2 ['] one-pass catch  ?dup  if 
     430      .error 
    426431      ." Journal replay failed" cr 
    427432      free-overlay-list free-revoke-list  free-journal  exit 
  • ofw/fs/ext2fs/sb.fth

    r2815 r2817  
    6262: unknown-extensions?   ( -- unsafe? ) 
    6363   compat-flags   h# ffffffff invert and        \ Accept all compat extensions 
    64    incompat-flags h# 00000002 invert and  or    \ Incompatible - accept FILETYPE 
    65    ro-flags       h# 00000003 invert and  or    \ RO - accept SPARSE_SUPER and LARGE_FILE 
     64   incompat-flags h# 00000002 invert and  or    \ Incompatible - accept FILETYPE, EXTENTS, FLEX_BG 
     65   ro-flags       h# 00000073 invert and  or    \ RO - accept SPARSE_SUPER, LARGE_FILE, GDT_CSUM, DIR_NLINK, EXTRA_ISIZE 
    6666; 
    6767: 'sb-uuid  ( -- adr )  super-block h# 68 +  ; 
Note: See TracChangeset for help on using the changeset viewer.