• Al Viro's avatar
    make ext2_get_page() and friends work without external serialization · be5b82db
    Al Viro authored
    Right now ext2_get_page() (and its analogues in a bunch of other filesystems)
    relies upon the directory being locked - the way it sets and tests Checked and
    Error bits would be racy without that.  Switch to a slightly different scheme,
    _not_ setting Checked in case of failure.  That way the logics becomes
    	if Checked => OK
    	else if Error => fail
    	else if !validate => fail
    	else => OK
    with validation setting Checked or Error on success and failure resp. and
    returning which one had happened.  Equivalent to the current logics, but unlike
    the current logics not sensitive to the order of set_bit, test_bit getting
    reordered by CPU, etc.
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    be5b82db
dir.c 16.3 KB