• Nick Piggin's avatar
    [PATCH] fix race in __block_prepare_write · f3ddbdc6
    Nick Piggin authored
    Fix a race where __block_prepare_write can leak out an in-flight read
    against a bh if get_block returns an error.  This can lead to the page
    becoming unlocked while the buffer is locked and the read still in flight.
    __mpage_writepage BUGs on this condition.
    
    BUG sighted on a 2-way Itanium2 system with 16K PAGE_SIZE running
    
    	fsstress -v -d $DIR/tmp -n 1000 -p 1000 -l 2
    
    where $DIR is a new ext2 filesystem with 4K blocks that is quite
    small (causing get_block to fail often with -ENOSPC).
    Signed-off-by: default avatarNick Piggin <nickpiggin@yahoo.com.au>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    f3ddbdc6
buffer.c 81.9 KB