hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/md/dm-integrity.c
....@@ -31,11 +31,11 @@
3131 #define DEFAULT_BUFFER_SECTORS 128
3232 #define DEFAULT_JOURNAL_WATERMARK 50
3333 #define DEFAULT_SYNC_MSEC 10000
34
-#define DEFAULT_MAX_JOURNAL_SECTORS 131072
34
+#define DEFAULT_MAX_JOURNAL_SECTORS (IS_ENABLED(CONFIG_64BIT) ? 131072 : 8192)
3535 #define MIN_LOG2_INTERLEAVE_SECTORS 3
3636 #define MAX_LOG2_INTERLEAVE_SECTORS 31
3737 #define METADATA_WORKQUEUE_MAX_ACTIVE 16
38
-#define RECALC_SECTORS 8192
38
+#define RECALC_SECTORS (IS_ENABLED(CONFIG_64BIT) ? 32768 : 2048)
3939 #define RECALC_WRITE_SUPER 16
4040 #define BITMAP_BLOCK_SIZE 4096 /* don't change it */
4141 #define BITMAP_FLUSH_INTERVAL (10 * HZ)
....@@ -4388,6 +4388,8 @@
43884388 BUG_ON(!RB_EMPTY_ROOT(&ic->in_progress));
43894389 BUG_ON(!list_empty(&ic->wait_list));
43904390
4391
+ if (ic->mode == 'B')
4392
+ cancel_delayed_work_sync(&ic->bitmap_flush_work);
43914393 if (ic->metadata_wq)
43924394 destroy_workqueue(ic->metadata_wq);
43934395 if (ic->wait_wq)
....@@ -4479,11 +4481,13 @@
44794481 }
44804482
44814483 r = dm_register_target(&integrity_target);
4482
-
4483
- if (r < 0)
4484
+ if (r < 0) {
44844485 DMERR("register failed %d", r);
4486
+ kmem_cache_destroy(journal_io_cache);
4487
+ return r;
4488
+ }
44854489
4486
- return r;
4490
+ return 0;
44874491 }
44884492
44894493 static void __exit dm_integrity_exit(void)