Skip to content

Commit f0b2769

Browse files
committed
Merge tag 'for-6.3/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
Pull device mapper updates from Mike Snitzer: - Fix DM cache target to free background tracker work items, otherwise slab BUG will occur when kmem_cache_destroy() is called. - Improve 2 of DM's shrinker names to reflect their use. - Fix the DM flakey target to not corrupt the zero page. Fix dm-flakey on 32-bit hughmem systems by using bvec_kmap_local instead of page_address. Also, fix logic used when imposing the "corrupt_bio_byte" feature. - Stop using WQ_UNBOUND for DM verity target's verify_wq because it causes significant Android latencies on ARM64 (and doesn't show real benefit on other architectures). - Add negative check to catch simple case of a DM table referencing itself. More complex scenarios that use intermediate devices to self-reference still need to be avoided/handled in userspace. - Fix DM core's resize to only send one uevent instead of two. This fixes a race with udev, that if udev wins, will cause udev to miss uevents (which caused premature unmount attempts by systemd). - Add cond_resched() to workqueue functions in DM core, dn-thin and dm-cache so that their loops aren't the cause of unintended cpu scheduling fairness issues. - Fix all of DM's checkpatch errors and warnings (famous last words). Various other small cleanups. * tag 'for-6.3/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: (62 commits) dm: remove unnecessary (void*) conversion in event_callback() dm ioctl: remove unnecessary check when using dm_get_mdptr() dm ioctl: assert _hash_lock is held in __hash_remove dm cache: add cond_resched() to various workqueue loops dm thin: add cond_resched() to various workqueue loops dm: add cond_resched() to dm_wq_requeue_work() dm: add cond_resched() to dm_wq_work() dm sysfs: make kobj_type structure constant dm: update targets using system workqueues to use a local workqueue dm: remove flush_scheduled_work() during local_exit() dm clone: prefer kvmalloc_array() dm: declare variables static when sensible dm: fix suspect indent whitespace dm ioctl: prefer strscpy() instead of strlcpy() dm: avoid void function return statements dm integrity: change macros min/max() -> min_t/max_t where appropriate dm: fix use of sizeof() macro dm: avoid 'do {} while(0)' loop in single statement macros dm log: avoid multiple line dereference dm log: avoid trailing semicolon in macro ...
2 parents 23064df + d695e44 commit f0b2769

File tree

113 files changed

+2311
-1849
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+2311
-1849
lines changed

drivers/md/dm-audit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-License-Identifier: GPL-2.0
1+
// SPDX-License-Identifier: GPL-2.0-only
22
/*
33
* Creating audit records for mapped devices.
44
*

drivers/md/dm-bio-prison-v1.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
12
/*
23
* Copyright (C) 2012 Red Hat, Inc.
34
*
@@ -77,9 +78,9 @@ static void __setup_new_cell(struct dm_cell_key *key,
7778
struct bio *holder,
7879
struct dm_bio_prison_cell *cell)
7980
{
80-
memcpy(&cell->key, key, sizeof(cell->key));
81-
cell->holder = holder;
82-
bio_list_init(&cell->bios);
81+
memcpy(&cell->key, key, sizeof(cell->key));
82+
cell->holder = holder;
83+
bio_list_init(&cell->bios);
8384
}
8485

8586
static int cmp_keys(struct dm_cell_key *lhs,
@@ -285,14 +286,14 @@ EXPORT_SYMBOL_GPL(dm_cell_promote_or_release);
285286

286287
struct dm_deferred_entry {
287288
struct dm_deferred_set *ds;
288-
unsigned count;
289+
unsigned int count;
289290
struct list_head work_items;
290291
};
291292

292293
struct dm_deferred_set {
293294
spinlock_t lock;
294-
unsigned current_entry;
295-
unsigned sweeper;
295+
unsigned int current_entry;
296+
unsigned int sweeper;
296297
struct dm_deferred_entry entries[DEFERRED_SET_SIZE];
297298
};
298299

@@ -338,7 +339,7 @@ struct dm_deferred_entry *dm_deferred_entry_inc(struct dm_deferred_set *ds)
338339
}
339340
EXPORT_SYMBOL_GPL(dm_deferred_entry_inc);
340341

341-
static unsigned ds_next(unsigned index)
342+
static unsigned int ds_next(unsigned int index)
342343
{
343344
return (index + 1) % DEFERRED_SET_SIZE;
344345
}
@@ -373,7 +374,7 @@ EXPORT_SYMBOL_GPL(dm_deferred_entry_dec);
373374
int dm_deferred_set_add_work(struct dm_deferred_set *ds, struct list_head *work)
374375
{
375376
int r = 1;
376-
unsigned next_entry;
377+
unsigned int next_entry;
377378

378379
spin_lock_irq(&ds->lock);
379380
if ((ds->sweeper == ds->current_entry) &&
@@ -432,7 +433,7 @@ static int __init dm_bio_prison_init(void)
432433

433434
return 0;
434435

435-
bad:
436+
bad:
436437
while (i--)
437438
_exits[i]();
438439

drivers/md/dm-bio-prison-v1.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
12
/*
23
* Copyright (C) 2011-2017 Red Hat, Inc.
34
*

drivers/md/dm-bio-prison-v2.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
12
/*
23
* Copyright (C) 2012-2017 Red Hat, Inc.
34
*
@@ -148,7 +149,7 @@ static bool __find_or_insert(struct dm_bio_prison_v2 *prison,
148149

149150
static bool __get(struct dm_bio_prison_v2 *prison,
150151
struct dm_cell_key_v2 *key,
151-
unsigned lock_level,
152+
unsigned int lock_level,
152153
struct bio *inmate,
153154
struct dm_bio_prison_cell_v2 *cell_prealloc,
154155
struct dm_bio_prison_cell_v2 **cell)
@@ -171,7 +172,7 @@ static bool __get(struct dm_bio_prison_v2 *prison,
171172

172173
bool dm_cell_get_v2(struct dm_bio_prison_v2 *prison,
173174
struct dm_cell_key_v2 *key,
174-
unsigned lock_level,
175+
unsigned int lock_level,
175176
struct bio *inmate,
176177
struct dm_bio_prison_cell_v2 *cell_prealloc,
177178
struct dm_bio_prison_cell_v2 **cell_result)
@@ -194,7 +195,7 @@ static bool __put(struct dm_bio_prison_v2 *prison,
194195

195196
// FIXME: shared locks granted above the lock level could starve this
196197
if (!cell->shared_count) {
197-
if (cell->exclusive_lock){
198+
if (cell->exclusive_lock) {
198199
if (cell->quiesce_continuation) {
199200
queue_work(prison->wq, cell->quiesce_continuation);
200201
cell->quiesce_continuation = NULL;
@@ -224,7 +225,7 @@ EXPORT_SYMBOL_GPL(dm_cell_put_v2);
224225

225226
static int __lock(struct dm_bio_prison_v2 *prison,
226227
struct dm_cell_key_v2 *key,
227-
unsigned lock_level,
228+
unsigned int lock_level,
228229
struct dm_bio_prison_cell_v2 *cell_prealloc,
229230
struct dm_bio_prison_cell_v2 **cell_result)
230231
{
@@ -255,7 +256,7 @@ static int __lock(struct dm_bio_prison_v2 *prison,
255256

256257
int dm_cell_lock_v2(struct dm_bio_prison_v2 *prison,
257258
struct dm_cell_key_v2 *key,
258-
unsigned lock_level,
259+
unsigned int lock_level,
259260
struct dm_bio_prison_cell_v2 *cell_prealloc,
260261
struct dm_bio_prison_cell_v2 **cell_result)
261262
{
@@ -291,7 +292,7 @@ EXPORT_SYMBOL_GPL(dm_cell_quiesce_v2);
291292

292293
static int __promote(struct dm_bio_prison_v2 *prison,
293294
struct dm_bio_prison_cell_v2 *cell,
294-
unsigned new_lock_level)
295+
unsigned int new_lock_level)
295296
{
296297
if (!cell->exclusive_lock)
297298
return -EINVAL;
@@ -302,7 +303,7 @@ static int __promote(struct dm_bio_prison_v2 *prison,
302303

303304
int dm_cell_lock_promote_v2(struct dm_bio_prison_v2 *prison,
304305
struct dm_bio_prison_cell_v2 *cell,
305-
unsigned new_lock_level)
306+
unsigned int new_lock_level)
306307
{
307308
int r;
308309

drivers/md/dm-bio-prison-v2.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
12
/*
23
* Copyright (C) 2011-2017 Red Hat, Inc.
34
*
@@ -44,8 +45,8 @@ struct dm_cell_key_v2 {
4445
struct dm_bio_prison_cell_v2 {
4546
// FIXME: pack these
4647
bool exclusive_lock;
47-
unsigned exclusive_level;
48-
unsigned shared_count;
48+
unsigned int exclusive_level;
49+
unsigned int shared_count;
4950
struct work_struct *quiesce_continuation;
5051

5152
struct rb_node node;
@@ -86,7 +87,7 @@ void dm_bio_prison_free_cell_v2(struct dm_bio_prison_v2 *prison,
8687
*/
8788
bool dm_cell_get_v2(struct dm_bio_prison_v2 *prison,
8889
struct dm_cell_key_v2 *key,
89-
unsigned lock_level,
90+
unsigned int lock_level,
9091
struct bio *inmate,
9192
struct dm_bio_prison_cell_v2 *cell_prealloc,
9293
struct dm_bio_prison_cell_v2 **cell_result);
@@ -114,7 +115,7 @@ bool dm_cell_put_v2(struct dm_bio_prison_v2 *prison,
114115
*/
115116
int dm_cell_lock_v2(struct dm_bio_prison_v2 *prison,
116117
struct dm_cell_key_v2 *key,
117-
unsigned lock_level,
118+
unsigned int lock_level,
118119
struct dm_bio_prison_cell_v2 *cell_prealloc,
119120
struct dm_bio_prison_cell_v2 **cell_result);
120121

@@ -132,7 +133,7 @@ void dm_cell_quiesce_v2(struct dm_bio_prison_v2 *prison,
132133
*/
133134
int dm_cell_lock_promote_v2(struct dm_bio_prison_v2 *prison,
134135
struct dm_bio_prison_cell_v2 *cell,
135-
unsigned new_lock_level);
136+
unsigned int new_lock_level);
136137

137138
/*
138139
* Adds any held bios to the bio list.

drivers/md/dm-bio-record.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
12
/*
23
* Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
34
*

0 commit comments

Comments
 (0)