Changeset 989 for vendor/current/source3/lib/dbwrap
- Timestamp:
- Nov 25, 2016, 8:04:54 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/lib/dbwrap/dbwrap_ctdb.c
r988 r989 1217 1217 bool ask_for_readonly_copy; 1218 1218 bool done; 1219 bool empty_record; 1219 1220 }; 1220 1221 … … 1236 1237 1237 1238 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 } 1239 1249 state->done = true; 1240 1250 } else { … … 1262 1272 state.parser = parser; 1263 1273 state.private_data = private_data; 1274 state.empty_record = false; 1264 1275 1265 1276 if (ctx->transaction != NULL) { … … 1293 1304 ctx, key, db_ctdb_parse_record_parser_nonpersistent, &state); 1294 1305 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 } 1295 1320 return NT_STATUS_OK; 1296 1321 } … … 1299 1324 state.ask_for_readonly_copy, parser, private_data); 1300 1325 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 } 1301 1336 return map_nt_error_from_unix(ret); 1302 1337 }
Note:
See TracChangeset
for help on using the changeset viewer.