Commit 9e983e1e authored by Hans Reiser's avatar Hans Reiser Committed by Linus Torvalds

[PATCH] reiserfs fix for inodes with wrong item versions (2.5)

   This is hopefully last bugfix for a bug introduced by struct inode splitting.
   Because of setting i_flags to some value and then cleaning the i_flags
   contents later, on-disk items received wrong item version ob v3.6 filesystems
parent f3c4ee09
...@@ -890,6 +890,13 @@ static void init_inode (struct inode * inode, struct path * path) ...@@ -890,6 +890,13 @@ static void init_inode (struct inode * inode, struct path * path)
inode->i_blksize = PAGE_SIZE; inode->i_blksize = PAGE_SIZE;
INIT_LIST_HEAD(&(REISERFS_I(inode)->i_prealloc_list )); INIT_LIST_HEAD(&(REISERFS_I(inode)->i_prealloc_list ));
REISERFS_I(inode)->i_flags = 0;
REISERFS_I(inode)->i_prealloc_block = 0;
REISERFS_I(inode)->i_prealloc_count = 0;
REISERFS_I(inode)->i_trans_id = 0;
REISERFS_I(inode)->i_trans_index = 0;
/* nopack = 0, by default */
REISERFS_I(inode)->i_flags &= ~i_nopack_mask;
if (stat_data_v1 (ih)) { if (stat_data_v1 (ih)) {
struct stat_data_v1 * sd = (struct stat_data_v1 *)B_I_PITEM (bh, ih); struct stat_data_v1 * sd = (struct stat_data_v1 *)B_I_PITEM (bh, ih);
...@@ -950,13 +957,6 @@ static void init_inode (struct inode * inode, struct path * path) ...@@ -950,13 +957,6 @@ static void init_inode (struct inode * inode, struct path * path)
set_inode_item_key_version (inode, KEY_FORMAT_3_6); set_inode_item_key_version (inode, KEY_FORMAT_3_6);
REISERFS_I(inode)->i_first_direct_byte = 0; REISERFS_I(inode)->i_first_direct_byte = 0;
} }
REISERFS_I(inode)->i_flags = 0;
REISERFS_I(inode)->i_prealloc_block = 0;
REISERFS_I(inode)->i_prealloc_count = 0;
REISERFS_I(inode)->i_trans_id = 0;
REISERFS_I(inode)->i_trans_index = 0;
/* nopack = 0, by default */
REISERFS_I(inode)->i_flags &= ~i_nopack_mask;
pathrelse (path); pathrelse (path);
if (S_ISREG (inode->i_mode)) { if (S_ISREG (inode->i_mode)) {
......
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