summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/persistent-data/dm-block-manager.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/md/persistent-data/dm-block-manager.c b/drivers/md/persistent-data/dm-block-manager.c
index 3972232b8037..749ec268d957 100644
--- a/drivers/md/persistent-data/dm-block-manager.c
+++ b/drivers/md/persistent-data/dm-block-manager.c
@@ -35,7 +35,10 @@
35#define MAX_HOLDERS 4 35#define MAX_HOLDERS 4
36#define MAX_STACK 10 36#define MAX_STACK 10
37 37
38typedef unsigned long stack_entries[MAX_STACK]; 38struct stack_store {
39 unsigned int nr_entries;
40 unsigned long entries[MAX_STACK];
41};
39 42
40struct block_lock { 43struct block_lock {
41 spinlock_t lock; 44 spinlock_t lock;
@@ -44,8 +47,7 @@ struct block_lock {
44 struct task_struct *holders[MAX_HOLDERS]; 47 struct task_struct *holders[MAX_HOLDERS];
45 48
46#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING 49#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
47 struct stack_trace traces[MAX_HOLDERS]; 50 struct stack_store traces[MAX_HOLDERS];
48 stack_entries entries[MAX_HOLDERS];
49#endif 51#endif
50}; 52};
51 53
@@ -73,7 +75,7 @@ static void __add_holder(struct block_lock *lock, struct task_struct *task)
73{ 75{
74 unsigned h = __find_holder(lock, NULL); 76 unsigned h = __find_holder(lock, NULL);
75#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING 77#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
76 struct stack_trace *t; 78 struct stack_store *t;
77#endif 79#endif
78 80
79 get_task_struct(task); 81 get_task_struct(task);
@@ -81,11 +83,7 @@ static void __add_holder(struct block_lock *lock, struct task_struct *task)
81 83
82#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING 84#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
83 t = lock->traces + h; 85 t = lock->traces + h;
84 t->nr_entries = 0; 86 t->nr_entries = stack_trace_save(t->entries, MAX_STACK, 2);
85 t->max_entries = MAX_STACK;
86 t->entries = lock->entries[h];
87 t->skip = 2;
88 save_stack_trace(t);
89#endif 87#endif
90} 88}
91 89
@@ -106,7 +104,8 @@ static int __check_holder(struct block_lock *lock)
106 DMERR("recursive lock detected in metadata"); 104 DMERR("recursive lock detected in metadata");
107#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING 105#ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
108 DMERR("previously held here:"); 106 DMERR("previously held here:");
109 print_stack_trace(lock->traces + i, 4); 107 stack_trace_print(lock->traces[i].entries,
108 lock->traces[i].nr_entries, 4);
110 109
111 DMERR("subsequent acquisition attempted here:"); 110 DMERR("subsequent acquisition attempted here:");
112 dump_stack(); 111 dump_stack();