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/lib/dbwrap/dbwrap_ctdb.c

    r988 r989  
    12171217        bool ask_for_readonly_copy;
    12181218        bool done;
     1219        bool empty_record;
    12191220};
    12201221
     
    12361237
    12371238        if (db_ctdb_can_use_local_hdr(header, true)) {
    1238                 state->parser(key, data, state->private_data);
     1239                /*
     1240                 * A record consisting only of the ctdb header can be
     1241                 * a validly created empty record or a tombstone
     1242                 * record of a deleted record (not vacuumed yet). Mark
     1243                 * it accordingly.
     1244                 */
     1245                state->empty_record = (data.dsize == 0);
     1246                if (!state->empty_record) {
     1247                        state->parser(key, data, state->private_data);
     1248                }
    12391249                state->done = true;
    12401250        } else {
     
    12621272        state.parser = parser;
    12631273        state.private_data = private_data;
     1274        state.empty_record = false;
    12641275
    12651276        if (ctx->transaction != NULL) {
     
    12931304                ctx, key, db_ctdb_parse_record_parser_nonpersistent, &state);
    12941305        if (NT_STATUS_IS_OK(status) && state.done) {
     1306                if (state.empty_record) {
     1307                        /*
     1308                         * We know authoritatively, that this is an empty
     1309                         * record. Since ctdb does not distinguish between empty
     1310                         * and deleted records, this can be a record stored as
     1311                         * empty or a not-yet-vacuumed tombstone record of a
     1312                         * deleted record. Now Samba right now can live without
     1313                         * empty records, so we can safely report this record
     1314                         * as non-existing.
     1315                         *
     1316                         * See bugs 10008 and 12005.
     1317                         */
     1318                        return NT_STATUS_NOT_FOUND;
     1319                }
    12951320                return NT_STATUS_OK;
    12961321        }
     
    12991324                          state.ask_for_readonly_copy, parser, private_data);
    13001325        if (ret != 0) {
     1326                if (ret == ENOENT) {
     1327                        /*
     1328                         * This maps to
     1329                         * NT_STATUS_OBJECT_NAME_NOT_FOUND. Our upper
     1330                         * layers expect NT_STATUS_NOT_FOUND for "no
     1331                         * record around". We need to convert dbwrap
     1332                         * to 0/errno away from NTSTATUS ... :-)
     1333                         */
     1334                        return NT_STATUS_NOT_FOUND;
     1335                }
    13011336                return map_nt_error_from_unix(ret);
    13021337        }
Note: See TracChangeset for help on using the changeset viewer.