-
- Downloads
ocfs2: Wrap inode block reads in a dedicated function.
The ocfs2 code currently reads inodes off disk with a simple ocfs2_read_block() call. Each place that does this has a different set of sanity checks it performs. Some check only the signature. A couple validate the block number (the block read vs di->i_blkno). A couple others check for VALID_FL. Only one place validates i_fs_generation. A couple check nothing. Even when an error is found, they don't all do the same thing. We wrap inode reading into ocfs2_read_inode_block(). This will validate all the above fields, going readonly if they are invalid (they never should be). ocfs2_read_inode_block_full() is provided for the places that want to pass read_block flags. Every caller is passing a struct inode with a valid ip_blkno, so we don't need a separate blkno argument either. We will remove the validation checks from the rest of the code in a later commit, as they are no longer necessary. Signed-off-by:Joel Becker <joel.becker@oracle.com> Signed-off-by:
Mark Fasheh <mfasheh@suse.com>
Showing
- fs/ocfs2/alloc.c 1 addition, 1 deletionfs/ocfs2/alloc.c
- fs/ocfs2/aops.c 2 additions, 9 deletionsfs/ocfs2/aops.c
- fs/ocfs2/dir.c 3 additions, 3 deletionsfs/ocfs2/dir.c
- fs/ocfs2/dlmglue.c 4 additions, 8 deletionsfs/ocfs2/dlmglue.c
- fs/ocfs2/extent_map.c 1 addition, 1 deletionfs/ocfs2/extent_map.c
- fs/ocfs2/file.c 5 additions, 16 deletionsfs/ocfs2/file.c
- fs/ocfs2/inode.c 98 additions, 38 deletionsfs/ocfs2/inode.c
- fs/ocfs2/inode.h 14 additions, 2 deletionsfs/ocfs2/inode.h
- fs/ocfs2/journal.c 1 addition, 2 deletionsfs/ocfs2/journal.c
- fs/ocfs2/localalloc.c 4 additions, 4 deletionsfs/ocfs2/localalloc.c
- fs/ocfs2/namei.c 2 additions, 12 deletionsfs/ocfs2/namei.c
- fs/ocfs2/symlink.c 1 addition, 1 deletionfs/ocfs2/symlink.c
Loading
Please register or sign in to comment