]> git.baikalelectronics.ru Git - kernel.git/commit
reiserfs: fix corruption introduced by balance_leaf refactor
authorJeff Mahoney <jeffm@suse.com>
Mon, 4 Aug 2014 23:51:47 +0000 (19:51 -0400)
committerJan Kara <jack@suse.cz>
Tue, 5 Aug 2014 21:18:38 +0000 (23:18 +0200)
commitb7c3d3315a2b672ccb4d1a4bae3ed6f3ed8e8112
treee981aaf33962bf22bdc70a83287434e77c3188e9
parentf05829881e9e7cc97d15c05722fd8f697078497f
reiserfs: fix corruption introduced by balance_leaf refactor

Commits 6deec9e7c47 (reiserfs: balance_leaf refactor, pull out
balance_leaf_insert_left) and 71c1786a61f (reiserfs: balance_leaf
refactor, pull out balance_leaf_paste_left) missed that the `body'
pointer was getting repositioned. Subsequent users of the pointer
would expect it to be repositioned, and as a result, parts of the
tree would get overwritten. The most common observed corruption
is indirect block pointers being overwritten.

Since the body value isn't actually used anymore in the called routines,
we can pass back the offset it should be shifted. We constify the body
and ih pointers in the balance_leaf as a mostly-free preventative measure.

Cc: <stable@vger.kernel.org> # 3.16
Reported-and-tested-by: Jeff Chua <jeff.chua.linux@gmail.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/reiserfs/do_balan.c
fs/reiserfs/lbalance.c
fs/reiserfs/reiserfs.h