]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ocfs2: correctly check the return value of ocfs2_search_extent_list
authorYingtai Xie <xieyingtai@huawei.com>
Thu, 26 Jun 2014 00:42:22 +0000 (10:42 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 26 Jun 2014 00:42:22 +0000 (10:42 +1000)
commit83b20391f0bc25f9f9dd91f98c55ab6cd6efddc7
tree117bfc23b47153da741c6a195eb27e554e64431b
parent74326d2ebfd0118fd3ca4fd6479d650c1b6d7782
ocfs2: correctly check the return value of ocfs2_search_extent_list

ocfs2_search_extent_list may return -1, so we should check the return
value in ocfs2_split_and_insert, otherwise it may cause array index out of
bound.

And ocfs2_search_extent_list can only return value less than
el->l_next_free_rec, so check if it is equal or larger than
le16_to_cpu(el->l_next_free_rec) is meaningless.

Signed-off-by: Yingtai Xie <xieyingtai@huawei.com>
Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/alloc.c
fs/ocfs2/move_extents.c
fs/ocfs2/refcounttree.c