Link [ NetBSD | NetBSD OpenGrok source search | PR fulltext-search | Summary of daily snapshot builds | history of daily build result | pkgsrc commit viewer ]


   
        usage: [branch:branch] [user:user] [path@revision] keyword [... [-excludekeyword [...]]] (e.g. branch:MAIN sys/arch/arm, if_wm.c@1.234 )




switch to index mode

recent branches: MAIN (4h)  netbsd-10 (16d)  netbsd-9 (16d)  netbsd-8 (21d) 

2024-06-02 04:48:09 UTC Now

2019-05-29 15:51:40 UTC netbsd-8 commitmail json YAML

Pull up following revision(s) (requested by kardel in ticket #1272):

sys/ufs/ffs/ffs_alloc.c: revision 1.164

PR/53990, PR/52380, PR/52102: UFS2 cylinder group inode allocation botch

Fix rare allocation botch in ffs_nodealloccg().

Conditions:
    a) less than
        #_of_initialized_inodes(cg->cg_initediblk)
        - inodes_per_filesystem_block
      are allocated in the cylinder group
    b) cg->cg_irotor points to a uninterupted run of
      allocated inodes in the inode bitmap up to the
      end of dynamically initialized inodes
      (cg->cg_initediblk)

In this case the next inode after this run was returned
without initializing the respective inode block. As the
block is not initialized these inodes could trigger panics
on inode consistency due to old (uninitialized) disk data.

In very rare cases data loss could occur when
the uninitialized inode block is initialized via the
normal mechanism.

Further conditions to occur after the above:
    c) no panic
    d) no (forced) fsck
    e) and more than cg->cg_initediblk - inodes_per_filesystem_block
      allocated inodes.

Fix:

Always insure allocation always in initialized inode range
extending the initialized inode range as needed.

Add KASSERTMSG() safeguards.

ok hannken@

(martin)