lkml.org 
[lkml]   [2002]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] reiserfs fix for incorrect key comparison
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
--- 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;
\
 
 \ /
  Last update: 2005-03-22 13:23    [W:0.318 / U:0.808 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site