return -1;
}
+ /* do not allow deleting record that have readonly flags set. */
+ if (hdr->flags & (CTDB_REC_RO_HAVE_DELEGATIONS|CTDB_REC_RO_HAVE_READONLY|CTDB_REC_RO_REVOKING_READONLY|CTDB_REC_RO_REVOKE_COMPLETE)) {
+ tdb_chainunlock(ctdb_db->ltdb->tdb, key);
+ DEBUG(DEBUG_INFO,(__location__ " Skipping record with readonly flags set\n"));
+ free(data.dptr);
+ return -1;
+ }
+ if (hdr2->flags & (CTDB_REC_RO_HAVE_DELEGATIONS|CTDB_REC_RO_HAVE_READONLY|CTDB_REC_RO_REVOKING_READONLY|CTDB_REC_RO_REVOKE_COMPLETE)) {
+ tdb_chainunlock(ctdb_db->ltdb->tdb, key);
+ DEBUG(DEBUG_INFO,(__location__ " Skipping record with readonly flags set\n"));
+ free(data.dptr);
+ return -1;
+ }
+
if (hdr2->dmaster == ctdb->pnn) {
tdb_chainunlock(ctdb_db->ltdb->tdb, key);
DEBUG(DEBUG_INFO,(__location__ " Attempted delete record where we are the dmaster\n"));
header = (struct ctdb_ltdb_header *)tdb_data.dptr;
+ if (header->flags & (CTDB_REC_RO_HAVE_DELEGATIONS|CTDB_REC_RO_HAVE_READONLY|CTDB_REC_RO_REVOKING_READONLY|CTDB_REC_RO_REVOKE_COMPLETE)) {
+ /* The record has readonly flags set. skip deleting */
+ vdata->delete_skipped++;
+ goto done;
+ }
+
if (header->dmaster != ctdb->pnn) {
/* The record has been migrated off the node. Skip. */
vdata->delete_skipped++;