• Volker Lendecke's avatar
    smbd: Fix a panic · bd511655
    Volker Lendecke authored
    Opening a file with a stale (smbd died) LEVEL_II oplock makes
    
    vfs_set_filelen-> ... ->contend_level2_oplocks_begin_default
    
    trigger the immediate leading to do_break_to_none. This goes through
    because fsp->oplock_type is not initialized yet, thus 0. Also,
    file_has_read_oplocks is still valid, because the smbd that has died
    could not clean up the brlock.tdb entry.
    
    Later in the code the exclusive oplock is granted, which is then found
    by do_break_to_none, making it panic.
    
    This patch just runs the direct FTRUNCATE instead of vfs_set_filelen.
    This means the contend_level2_oplock code is skipped.
    
    The relevant break (LEVEL_II to NONE) is now done in delay_for_oplock()
    with the nice effect of removing a comment that was very confusing to
    me.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=13957Signed-off-by: 's avatarVolker Lendecke <vl@samba.org>
    Reviewed-by: 's avatarRalph Boehme <slow@samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow@samba.org>
    Autobuild-Date(master): Wed May 22 20:09:29 UTC 2019 on sn-devel-184
    bd511655
Name
Last commit
Last update
..
flapping.d Loading commit data...
gnupg Loading commit data...
knownfail.d Loading commit data...
manage-ca Loading commit data...
target Loading commit data...
README Loading commit data...
SocketWrapper.pm Loading commit data...
Subunit.pm Loading commit data...
TODO Loading commit data...
devel_env.sh Loading commit data...
filter-subunit Loading commit data...
flapping Loading commit data...
format-subunit Loading commit data...
format-subunit-json Loading commit data...
gdb_backtrace Loading commit data...
gdb_backtrace_test.c Loading commit data...
gdb_run Loading commit data...
in_screen Loading commit data...
knownfail Loading commit data...
perf_tests.py Loading commit data...
quick Loading commit data...
save.env.sh Loading commit data...
selftest.pl Loading commit data...
selftest.pl.1 Loading commit data...
selftesthelpers.py Loading commit data...
skip Loading commit data...
skip.no-GSS_KRB5_CRED_NO_CI_FLAGS_X Loading commit data...
skip_mit_kdc Loading commit data...
slow Loading commit data...
subunithelper.py Loading commit data...
tap2subunit Loading commit data...
tests.py Loading commit data...
valgrind_run Loading commit data...
wscript Loading commit data...