mirror of
https://github.com/samba-team/samba.git
synced 2025-03-01 04:58:35 +03:00
recover: use CTDB_REC_RO_FLAGS where appropriate
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-By: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit b5a8791268e938d7e017056e0e2bd2cbec1fa690)
This commit is contained in:
parent
666985bc3a
commit
217d2ad7b8
@ -418,7 +418,7 @@ int32_t ctdb_control_push_db(struct ctdb_context *ctdb, TDB_DATA indata)
|
||||
/* strip off any read only record flags. All readonly records
|
||||
are revoked implicitely by a recovery
|
||||
*/
|
||||
hdr->flags &= ~(CTDB_REC_RO_HAVE_DELEGATIONS|CTDB_REC_RO_HAVE_READONLY|CTDB_REC_RO_REVOKING_READONLY|CTDB_REC_RO_REVOKE_COMPLETE);
|
||||
hdr->flags &= ~CTDB_REC_RO_FLAGS;
|
||||
|
||||
data.dptr += sizeof(*hdr);
|
||||
data.dsize -= sizeof(*hdr);
|
||||
@ -843,13 +843,13 @@ static int delete_tdb_record(struct ctdb_context *ctdb, struct ctdb_db_context *
|
||||
}
|
||||
|
||||
/* 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)) {
|
||||
if (hdr->flags & CTDB_REC_RO_FLAGS) {
|
||||
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)) {
|
||||
if (hdr2->flags & CTDB_REC_RO_FLAGS) {
|
||||
tdb_chainunlock(ctdb_db->ltdb->tdb, key);
|
||||
DEBUG(DEBUG_INFO,(__location__ " Skipping record with readonly flags set\n"));
|
||||
free(data.dptr);
|
||||
@ -1158,21 +1158,13 @@ static int store_tdb_record(struct ctdb_context *ctdb,
|
||||
}
|
||||
|
||||
/* do not allow vacuuming of records 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))
|
||||
{
|
||||
if (hdr->flags & CTDB_REC_RO_FLAGS) {
|
||||
DEBUG(DEBUG_INFO,(__location__ " Skipping record with readonly "
|
||||
"flags set\n"));
|
||||
ret = -1;
|
||||
goto done;
|
||||
}
|
||||
if (hdr2->flags & (CTDB_REC_RO_HAVE_DELEGATIONS|
|
||||
CTDB_REC_RO_HAVE_READONLY|
|
||||
CTDB_REC_RO_REVOKING_READONLY|
|
||||
CTDB_REC_RO_REVOKE_COMPLETE))
|
||||
{
|
||||
if (hdr2->flags & CTDB_REC_RO_FLAGS) {
|
||||
DEBUG(DEBUG_INFO,(__location__ " Skipping record with readonly "
|
||||
"flags set\n"));
|
||||
ret = -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user