Skip to content

Commit 4f4b1c5

Browse files
Mikulas Patockagregkh
authored andcommitted
dm integrity: change 'suspending' variable from bool to int
commit c21b163 upstream. Early alpha processors can't write a byte or short atomically - they read 8 bytes, modify the byte or two bytes in registers and write back 8 bytes. The modification of the variable "suspending" may race with modification of the variable "failed". Fix this by changing "suspending" to an int. Cc: [email protected] Signed-off-by: Mikulas Patocka <[email protected]> Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5f04d29 commit 4f4b1c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/md/dm-integrity.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ struct dm_integrity_c {
177177
__u8 sectors_per_block;
178178

179179
unsigned char mode;
180-
bool suspending;
180+
int suspending;
181181

182182
int failed;
183183

@@ -2209,7 +2209,7 @@ static void dm_integrity_postsuspend(struct dm_target *ti)
22092209

22102210
del_timer_sync(&ic->autocommit_timer);
22112211

2212-
ic->suspending = true;
2212+
WRITE_ONCE(ic->suspending, 1);
22132213

22142214
queue_work(ic->commit_wq, &ic->commit_work);
22152215
drain_workqueue(ic->commit_wq);
@@ -2219,7 +2219,7 @@ static void dm_integrity_postsuspend(struct dm_target *ti)
22192219
dm_integrity_flush_buffers(ic);
22202220
}
22212221

2222-
ic->suspending = false;
2222+
WRITE_ONCE(ic->suspending, 0);
22232223

22242224
BUG_ON(!RB_EMPTY_ROOT(&ic->in_progress));
22252225

0 commit comments

Comments
 (0)