#include "drbd_int.h"
#include "drbd_wrappers.h"
+
+enum al_transaction_types {
+ AL_TR_UPDATE = 0,
+ AL_TR_INITIALIZED = 0xffff
+};
/* all fields on disc in big endian */
struct __packed al_transaction_on_disk {
/* don't we all like magic */
__be32 crc32c;
/* type of transaction, special transaction types like:
- * purge-all, set-all-idle, set-all-active, ... to-be-defined */
+ * purge-all, set-all-idle, set-all-active, ... to-be-defined
+ * see also enum al_transaction_types */
__be16 transaction_type;
/* we currently allow only a few thousand extents,
int active_extents = 0;
int transactions = 0;
int found_valid = 0;
+ int found_initialized = 0;
int from = 0;
int to = 0;
u32 from_tnr = 0;
/* invalid data in that block */
if (rv == 0)
continue;
+ if (be16_to_cpu(b->transaction_type) == AL_TR_INITIALIZED) {
+ ++found_initialized;
+ continue;
+ }
/* IO error */
if (rv == -1) {
}
if (!found_valid) {
- dev_warn(DEV, "No usable activity log found.\n");
+ if (found_initialized != mx)
+ dev_warn(DEV, "No usable activity log found.\n");
mutex_unlock(&mdev->md_io_mutex);
return 1;
}