Skip to content

Commit

Permalink
[PATCH] reiserfs: fix key decrementing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vladimir Saveliev authored and Linus Torvalds committed Apr 12, 2007
1 parent 505fa2c commit 6d205f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/reiserfs/item_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static void sd_decrement_key(struct cpu_key *key)
{
key->on_disk_key.k_objectid--;
set_cpu_key_k_type(key, TYPE_ANY);
set_cpu_key_k_offset(key, (loff_t) (-1));
set_cpu_key_k_offset(key, (loff_t)(~0ULL >> 1));
}

static int sd_is_left_mergeable(struct reiserfs_key *key, unsigned long bsize)
Expand Down

0 comments on commit 6d205f1

Please sign in to comment.