Commit e2d964e6 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix ext3 htree corruption on big-endian platforms

From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>

current bk 2.6.0 corrupts my ext3 filesystems, usually in the RESYNC dir
during a bk pull.  Checking the recent changes I noticed that the one in
fs/ext3/namei.c misses an endian conversion.  The attached patch fixes that
and works fine for me since 2 days now on PPC.
parent b6029830
...@@ -1306,7 +1306,7 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry, ...@@ -1306,7 +1306,7 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
/* The 0th block becomes the root, move the dirents out */ /* The 0th block becomes the root, move the dirents out */
fde = &root->dotdot; fde = &root->dotdot;
de = (struct ext3_dir_entry_2 *)((char *)fde + fde->rec_len); de = (struct ext3_dir_entry_2 *)((char *)fde + le16_to_cpu(fde->rec_len));
len = ((char *) root) + blocksize - (char *) de; len = ((char *) root) + blocksize - (char *) de;
memcpy (data1, de, len); memcpy (data1, de, len);
de = (struct ext3_dir_entry_2 *) data1; de = (struct ext3_dir_entry_2 *) data1;
......
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