Skip to content

Commit

Permalink
reiserfs: Initialize inode keys properly
Browse files Browse the repository at this point in the history
reiserfs_read_locked_inode() didn't initialize key length properly. Use
_make_cpu_key() macro for key initialization so that all key member are
properly initialized.

CC: [email protected]
Reported-by: [email protected]
Signed-off-by: Jan Kara <[email protected]>
  • Loading branch information
jankara committed Sep 22, 2020
1 parent a7be300 commit 4443390
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions fs/reiserfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1551,11 +1551,7 @@ void reiserfs_read_locked_inode(struct inode *inode,
* set version 1, version 2 could be used too, because stat data
* key is the same in both versions
*/
key.version = KEY_FORMAT_3_5;
key.on_disk_key.k_dir_id = dirino;
key.on_disk_key.k_objectid = inode->i_ino;
key.on_disk_key.k_offset = 0;
key.on_disk_key.k_type = 0;
_make_cpu_key(&key, KEY_FORMAT_3_5, dirino, inode->i_ino, 0, 0, 3);

/* look for the object's stat data */
retval = search_item(inode->i_sb, &key, &path_to_sd);
Expand Down

0 comments on commit 4443390

Please sign in to comment.