[PATCH] reiserfs fix for incorrect key comparison

Oleg Drokin on behalf of Hans Reiser (reiser@namesys.com)
Tue, 5 Feb 2002 14:49:17 +0300


--oyUTqETQ0mS9luUI
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello!

This is to fix certain cases where items may get its keys to be interpreted
wrong and cause reiserfs to panic, 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.

Bye,
Oleg

--oyUTqETQ0mS9luUI
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="pick_correct_key_version.diff"

--- linux-2.5.3/fs/reiserfs/stree.c.orig Thu Jan 31 19:24:47 2002
+++ linux-2.5.3/fs/reiserfs/stree.c Thu Jan 31 19:26:54 2002
@@ -126,19 +126,19 @@
retval = comp_short_keys (le_key, cpu_key);
if (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;
- 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;

if (cpu_key->key_length == 3)
return 0;

/* 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;

- 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 0;

--oyUTqETQ0mS9luUI--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/