• Ryusuke Konishi's avatar
    nilfs2: ensure proper cache clearing for gc-inodes · fbb24a3a
    Ryusuke Konishi authored
    A gc-inode is a pseudo inode used to buffer the blocks to be moved by
    garbage collection.
    
    Block caches of gc-inodes must be cleared every time a garbage collection
    function (nilfs_clean_segments) completes.  Otherwise, stale blocks
    buffered in the caches may be wrongly reused in successive calls of the GC
    function.
    
    For user files, this is not a problem because their gc-inodes are
    distinguished by a checkpoint number as well as an inode number.  They
    never buffer different blocks if either an inode number, a checkpoint
    number, or a block offset differs.
    
    However, gc-inodes of sufile, cpfile and DAT file can store different data
    for the same block offset.  Thus, the nilfs_clean_segments function can
    move incorrect block for these meta-data files if an old block is cached.
    I found this is really causing meta-data corruption in nilfs.
    
    This fixes the issue by ensuring cache clear of gc-inodes and resolves
    reported GC problems including checkpoint file corruption, b-tree
    corruption, and the following warning during GC.
    
      nilfs_palloc_freev: entry number 307234 already freed.
      ...
    Signed-off-by: 's avatarRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Tested-by: 's avatarRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Cc: <stable@vger.kernel.org>	[2.6.37+]
    Signed-off-by: 's avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
    fbb24a3a
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
alloc.c Loading commit data...
alloc.h Loading commit data...
bmap.c Loading commit data...
bmap.h Loading commit data...
btnode.c Loading commit data...
btnode.h Loading commit data...
btree.c Loading commit data...
btree.h Loading commit data...
cpfile.c Loading commit data...
cpfile.h Loading commit data...
dat.c Loading commit data...
dat.h Loading commit data...
dir.c Loading commit data...
direct.c Loading commit data...
direct.h Loading commit data...
export.h Loading commit data...
file.c Loading commit data...
gcinode.c Loading commit data...
ifile.c Loading commit data...
ifile.h Loading commit data...
inode.c Loading commit data...
ioctl.c Loading commit data...
mdt.c Loading commit data...
mdt.h Loading commit data...
namei.c Loading commit data...
nilfs.h Loading commit data...
page.c Loading commit data...
page.h Loading commit data...
recovery.c Loading commit data...
segbuf.c Loading commit data...
segbuf.h Loading commit data...
segment.c Loading commit data...
segment.h Loading commit data...
sufile.c Loading commit data...
sufile.h Loading commit data...
super.c Loading commit data...
the_nilfs.c Loading commit data...
the_nilfs.h Loading commit data...