• Bob Peterson's avatar
    gfs2: Don't demote a glock until its revokes are written · df5db5f9
    Bob Peterson authored
    Before this patch, run_queue would demote glocks based on whether
    there are any more holders. But if the glock has pending revokes that
    haven't been written to the media, giving up the glock might end in
    file system corruption if the revokes never get written due to
    io errors, node crashes and fences, etc. In that case, another node
    will replay the metadata blocks associated with the glock, but
    because the revoke was never written, it could replay that block
    even though the glock had since been granted to another node who
    might have made changes.
    
    This patch changes the logic in run_queue so that it never demotes
    a glock until its count of pending revokes reaches zero.
    Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
    Reviewed-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
    df5db5f9
glock.c 59.7 KB