Commit 0a1ce1ed authored by Hans Reiser's avatar Hans Reiser Committed by Linus Torvalds

[PATCH] reiserfs patchset, patch 1 of 9 01-pick_correct_key_version.diff

01-pick_correct_key_version.diff
    This is to fix certain cases where items may get its keys to be interpreted
    wrong, or to be inserted into the tree in wrong order. This bug was only
    observed live on 2.5.3, though it is present in 2.4, too.
parent 32d57b6c
...@@ -126,19 +126,19 @@ inline int comp_keys (const struct key * le_key, const struct cpu_key * cpu_key ...@@ -126,19 +126,19 @@ inline int comp_keys (const struct key * le_key, const struct cpu_key * cpu_key
retval = comp_short_keys (le_key, cpu_key); retval = comp_short_keys (le_key, cpu_key);
if (retval) if (retval)
return retval; return retval;
if (le_key_k_offset (cpu_key->version, le_key) < cpu_key_k_offset (cpu_key)) if (le_key_k_offset (le_key_version(le_key), le_key) < cpu_key_k_offset (cpu_key))
return -1; return -1;
if (le_key_k_offset (cpu_key->version, le_key) > cpu_key_k_offset (cpu_key)) if (le_key_k_offset (le_key_version(le_key), le_key) > cpu_key_k_offset (cpu_key))
return 1; return 1;
if (cpu_key->key_length == 3) if (cpu_key->key_length == 3)
return 0; return 0;
/* this part is needed only when tail conversion is in progress */ /* this part is needed only when tail conversion is in progress */
if (le_key_k_type (cpu_key->version, le_key) < cpu_key_k_type (cpu_key)) if (le_key_k_type (le_key_version(le_key), le_key) < cpu_key_k_type (cpu_key))
return -1; return -1;
if (le_key_k_type (cpu_key->version, le_key) > cpu_key_k_type (cpu_key)) if (le_key_k_type (le_key_version(le_key), le_key) > cpu_key_k_type (cpu_key))
return 1; return 1;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment