summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/inode.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2014-06-12 13:23:41 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2014-07-09 05:58:08 -0700
commitd6b7d4b31dfd5a454a71c445b8086bc098237334 (patch)
treeb4316bf1bf36d7c22c243a520488259b19986f5c /fs/f2fs/inode.c
parent8bc6f60e3f7f31c4ce370b4b27b8f4b355b7f07e (diff)
downloadlinux-d6b7d4b31dfd5a454a71c445b8086bc098237334.tar.gz
linux-d6b7d4b31dfd5a454a71c445b8086bc098237334.tar.bz2
linux-d6b7d4b31dfd5a454a71c445b8086bc098237334.zip
f2fs: check lower bound nid value in check_nid_range
This patch add lower bound verification for nid in check_nid_range, so nids reserved like 0, node, meta passed by caller could be checked there. And then check_nid_range could be used in f2fs_nfs_get_inode for simplifying code. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/inode.c')
-rw-r--r--fs/f2fs/inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index adc622c6bdce..2cf6962f6cc8 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -78,6 +78,7 @@ static int do_read_inode(struct inode *inode)
if (check_nid_range(sbi, inode->i_ino)) {
f2fs_msg(inode->i_sb, KERN_ERR, "bad inode number: %lu",
(unsigned long) inode->i_ino);
+ WARN_ON(1);
return -EINVAL;
}