Ignore:
Timestamp:
Nov 25, 2016, 8:04:54 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/smbd/oplock.c

    r988 r989  
    191191                 * If we're the only one, we don't need a brlock entry
    192192                 */
     193                remove_stale_share_mode_entries(d);
    193194                SMB_ASSERT(d->num_share_modes == 1);
    194195                SMB_ASSERT(EXCLUSIVE_OPLOCK_TYPE(d->share_modes[0].op_type));
     
    220221        TALLOC_FREE(br_lck);
    221222        return true;
     223}
     224
     225/****************************************************************************
     226 Remove a file oplock with lock already held. Copes with level II and exclusive.
     227****************************************************************************/
     228
     229bool remove_oplock_under_lock(files_struct *fsp, struct share_mode_lock *lck)
     230{
     231        bool ret;
     232
     233        ret = remove_share_oplock(lck, fsp);
     234        if (!ret) {
     235                DBG_ERR("failed to remove share oplock for "
     236                        "file %s, %s, %s\n",
     237                        fsp_str_dbg(fsp), fsp_fnum_dbg(fsp),
     238                        file_id_string_tos(&fsp->file_id));
     239        }
     240        release_file_oplock(fsp);
     241
     242        ret = update_num_read_oplocks(fsp, lck);
     243        if (!ret) {
     244                DBG_ERR("update_num_read_oplocks failed for "
     245                        "file %s, %s, %s\n",
     246                        fsp_str_dbg(fsp), fsp_fnum_dbg(fsp),
     247                        file_id_string_tos(&fsp->file_id));
     248        }
     249
     250        return ret;
    222251}
    223252
     
    233262        struct share_mode_lock *lck;
    234263
    235         DEBUG(10, ("remove_oplock called for %s\n",
    236                    fsp_str_dbg(fsp)));
     264        DBG_DEBUG("remove_oplock called for %s\n", fsp_str_dbg(fsp));
    237265
    238266        /* Remove the oplock flag from the sharemode. */
    239267        lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id);
    240268        if (lck == NULL) {
    241                 DEBUG(0,("remove_oplock: failed to lock share entry for "
    242                          "file %s\n", fsp_str_dbg(fsp)));
    243                 return False;
    244         }
    245 
    246         ret = remove_share_oplock(lck, fsp);
    247         if (!ret) {
    248                 DEBUG(0,("remove_oplock: failed to remove share oplock for "
    249                          "file %s, %s, %s\n",
    250                          fsp_str_dbg(fsp), fsp_fnum_dbg(fsp),
    251                          file_id_string_tos(&fsp->file_id)));
    252         }
    253         release_file_oplock(fsp);
    254 
    255         ret = update_num_read_oplocks(fsp, lck);
    256         if (!ret) {
    257                 DEBUG(0, ("%s: update_num_read_oplocks failed for "
    258                          "file %s, %s, %s\n",
    259                           __func__, fsp_str_dbg(fsp), fsp_fnum_dbg(fsp),
    260                          file_id_string_tos(&fsp->file_id)));
    261         }
     269                DBG_ERR("failed to lock share entry for "
     270                         "file %s\n", fsp_str_dbg(fsp));
     271                return false;
     272        }
     273
     274        ret = remove_oplock_under_lock(fsp, lck);
    262275
    263276        TALLOC_FREE(lck);
Note: See TracChangeset for help on using the changeset viewer.