Commit cc4f274a authored by Dave Kleikamp's avatar Dave Kleikamp Committed by ZhangPeng
Browse files

Revert "jfs: fix shift-out-of-bounds in dbJoin"

stable inclusion
from stable-v6.6.47
commit 6fb93eeb25e56cbb782b4273baaf8c19ce1da9c6
bugzilla: https://gitee.com/openeuler/kernel/issues/IAHMJO

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6fb93eeb25e56cbb782b4273baaf8c19ce1da9c6



--------------------------------

commit e42e29cc442395d62f1a8963ec2dfb700ba6a5d7 upstream.

This reverts commit cca974daeb6c43ea971f8ceff5a7080d7d49ee30.

The added sanity check is incorrect. BUDMIN is not the wrong value and
is too small.

Signed-off-by: default avatarDave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarZhangPeng <zhangpeng362@huawei.com>
parent 87a1b401
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -2765,9 +2765,7 @@ static int dbBackSplit(dmtree_t *tp, int leafno, bool is_ctl)
 *	leafno	- the number of the leaf to be updated.
 *	newval	- the new value for the leaf.
 *
 * RETURN VALUES:
 *  0		- success
 *	-EIO	- i/o error
 * RETURN VALUES: none
 */
static int dbJoin(dmtree_t *tp, int leafno, int newval, bool is_ctl)
{
@@ -2794,10 +2792,6 @@ static int dbJoin(dmtree_t *tp, int leafno, int newval, bool is_ctl)
		 * get the buddy size (number of words covered) of
		 * the new value.
		 */

		if ((newval - tp->dmt_budmin) > BUDMIN)
			return -EIO;

		budsz = BUDSIZE(newval, tp->dmt_budmin);

		/* try to join.