diff options
author | Chao Yu <chao2.yu@samsung.com> | 2014-03-12 05:08:36 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-03-12 05:15:38 -0400 |
commit | 910bb12d29cc64144506333bfeaeeee9715c3872 (patch) | |
tree | f93756833c6f2c2074f2a91b5dee46bb98286cd4 /fs/f2fs/super.c | |
parent | 987c7c31123fd36c1f792ff53ff131378475f5c8 (diff) |
f2fs: check upper bound of ino value in f2fs_nfs_get_inode
Upper bound checking of ino should be added to f2fs_nfs_get_inode, so unneeded
process before do_read_inode in f2fs_iget could be avoided when ino is invalid.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r-- | fs/f2fs/super.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 6e4851ce029b..3a51d7a4a6c9 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c | |||
@@ -644,6 +644,8 @@ static struct inode *f2fs_nfs_get_inode(struct super_block *sb, | |||
644 | 644 | ||
645 | if (unlikely(ino < F2FS_ROOT_INO(sbi))) | 645 | if (unlikely(ino < F2FS_ROOT_INO(sbi))) |
646 | return ERR_PTR(-ESTALE); | 646 | return ERR_PTR(-ESTALE); |
647 | if (unlikely(ino >= NM_I(sbi)->max_nid)) | ||
648 | return ERR_PTR(-ESTALE); | ||
647 | 649 | ||
648 | /* | 650 | /* |
649 | * f2fs_iget isn't quite right if the inode is currently unallocated! | 651 | * f2fs_iget isn't quite right if the inode is currently unallocated! |