dm integrity: set journal entry unused when shrinking device
stable inclusion from stable-v5.10.110 commit b101e74f9a72d106e87ed2a43c5f47f6e15c4a54 bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b101e74f9a72d106e87ed2a43c5f47f6e15c4a54 -------------------------------- commit cc09e8a9 upstream. Commit f6f72f32 ("dm integrity: don't replay journal data past the end of the device") skips journal replay if the target sector points beyond the end of the device. Unfortunatelly, it doesn't set the journal entry unused, which resulted in this BUG being triggered: BUG_ON(!journal_entry_is_unused(je)) Fix this by calling journal_entry_set_unused() for this case. Fixes: f6f72f32 ("dm integrity: don't replay journal data past the end of the device") Cc: stable@vger.kernel.org # v5.7+ Signed-off-by: NMikulas Patocka <mpatocka@redhat.com> Tested-by: NMilan Broz <gmazyland@gmail.com> [snitzer: revised header] Signed-off-by: NMike Snitzer <snitzer@kernel.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NYu Liao <liaoyu15@huawei.com> Reviewed-by: NWei Li <liwei391@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录