aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
authorVladimir Saveliev <vs@namesys.com>2007-04-12 02:28:44 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-12 18:31:42 -0400
commit6d205f120547043de663315698dcf5f0eaa31b5c (patch)
treec2b4b8d41361d498bdf8abad6fc9d06086bab56d /fs/reiserfs
parent505fa2c4a2f125a70951926dfb22b9cf273994f1 (diff)
[PATCH] reiserfs: fix key decrementing
This patch fixes a bug in function decrementing a key of stat data item. Offset of reiserfs keys are compared as signed values. To set key offset to maximal possible value maximal signed value has to be used. This bug is responsible for severe reiserfs filesystem corruption which shows itself as warning vs-13060. reiserfsck fixes this corruption by filesystem tree rebuilding. Signed-off-by: Vladimir Saveliev <vs@namesys.com> Cc: <reiserfs-dev@namesys.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/item_ops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
index b9b423b22a8b..9475557ab499 100644
--- a/fs/reiserfs/item_ops.c
+++ b/fs/reiserfs/item_ops.c
@@ -23,7 +23,7 @@ static void sd_decrement_key(struct cpu_key *key)
23{ 23{
24 key->on_disk_key.k_objectid--; 24 key->on_disk_key.k_objectid--;
25 set_cpu_key_k_type(key, TYPE_ANY); 25 set_cpu_key_k_type(key, TYPE_ANY);
26 set_cpu_key_k_offset(key, (loff_t) (-1)); 26 set_cpu_key_k_offset(key, (loff_t)(~0ULL >> 1));
27} 27}
28 28
29static int sd_is_left_mergeable(struct reiserfs_key *key, unsigned long bsize) 29static int sd_is_left_mergeable(struct reiserfs_key *key, unsigned long bsize)