• Evgeniy Dushistov's avatar
    [PATCH] ufs: fix hang during `rm' · 09114eb8
    Evgeniy Dushistov authored
    This fixes the code like this:
    
    	bh = sb_find_get_block (sb, tmp + j);
    	if ((bh && DATA_BUFFER_USED(bh)) || tmp != fs32_to_cpu(sb, *p)) {
    		retry = 1;
    		brelse (bh);
    		goto next1;
    	}
    	bforget (bh);
    
    sb_find_get_block() ordinarily returns a buffer_head with b_count>=2, and
    this code assume that in case if "b_count>1" buffer is used, so this caused
    infinite loop.
    
    (akpm: that is-the-buffer-busy code is incomprehensible.  Good riddance.  Use
    of block_truncate_page() seems sane).
    Signed-off-by: default avatarEvgeniy Dushistov <dushistov@mail.ru>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    09114eb8
inode.c 22 KB