Commit 118ba36
Mikulas Patocka
dm-integrity: fix recalculation in bitmap mode
There's a logic quirk in the handling of suspend in the bitmap mode:
This is the sequence of calls if we are reloading a dm-integrity table:
* dm_integrity_ctr reads a superblock with the flag SB_FLAG_DIRTY_BITMAP
set.
* dm_integrity_postsuspend initializes a journal and clears the flag
SB_FLAG_DIRTY_BITMAP.
* dm_integrity_resume sees the superblock with SB_FLAG_DIRTY_BITMAP set -
thus it interprets the journal as if it were a bitmap.
This quirk causes recalculation problem if the user increases the size of
the device in the bitmap mode.
Fix this by reading a fresh copy on the superblock in
dm_integrity_resume. This commit also fixes another logic quirk - the
branch that sets bitmap bits if the device was extended should only be
executed if the flag SB_FLAG_DIRTY_BITMAP is set.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Tested-by: Ondrej Kozina <okozina@redhat.com>
Fixes: 468dfca ("dm integrity: add a bitmap mode")
Cc: stable@vger.kernel.org1 parent be9badc commit 118ba36
1 file changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3788 | 3788 | | |
3789 | 3789 | | |
3790 | 3790 | | |
| 3791 | + | |
3791 | 3792 | | |
3792 | 3793 | | |
3793 | 3794 | | |
3794 | 3795 | | |
3795 | 3796 | | |
| 3797 | + | |
| 3798 | + | |
| 3799 | + | |
| 3800 | + | |
| 3801 | + | |
| 3802 | + | |
| 3803 | + | |
| 3804 | + | |
| 3805 | + | |
| 3806 | + | |
| 3807 | + | |
3796 | 3808 | | |
3797 | 3809 | | |
3798 | 3810 | | |
| 3811 | + | |
3799 | 3812 | | |
3800 | 3813 | | |
3801 | 3814 | | |
| |||
0 commit comments