• Germano Percossi's avatar
    CIFS: store results of cifs_reopen_file to avoid infinite wait · 1fa839b4
    Germano Percossi authored
    This fixes Continuous Availability when errors during
    file reopen are encountered.
    
    cifs_user_readv and cifs_user_writev would wait for ever if
    results of cifs_reopen_file are not stored and for later inspection.
    
    In fact, results are checked and, in case of errors, a chain
    of function calls leading to reads and writes to be scheduled in
    a separate thread is skipped.
    These threads will wake up the corresponding waiters once reads
    and writes are done.
    
    However, given the return value is not stored, when rc is checked
    for errors a previous one (always zero) is inspected instead.
    This leads to pending reads/writes added to the list, making
    cifs_user_readv and cifs_user_writev wait for ever.
    Signed-off-by: default avatarGermano Percossi <germano.percossi@citrix.com>
    Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
    CC: Stable <stable@vger.kernel.org>
    Signed-off-by: default avatarSteve French <smfrench@gmail.com>
    1fa839b4
file.c 102 KB