Skip to content

Commit c21b163

Browse files
Mikulas Patockasnitm
authored andcommitted
dm integrity: change 'suspending' variable from bool to int
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]>
1 parent cda6b5a commit c21b163

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
@@ -178,7 +178,7 @@ struct dm_integrity_c {
178178
__u8 sectors_per_block;
179179

180180
unsigned char mode;
181-
bool suspending;
181+
int suspending;
182182

183183
int failed;
184184

@@ -2210,7 +2210,7 @@ static void dm_integrity_postsuspend(struct dm_target *ti)
22102210

22112211
del_timer_sync(&ic->autocommit_timer);
22122212

2213-
ic->suspending = true;
2213+
WRITE_ONCE(ic->suspending, 1);
22142214

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

2223-
ic->suspending = false;
2223+
WRITE_ONCE(ic->suspending, 0);
22242224

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

0 commit comments

Comments
 (0)