@@ -122,6 +122,10 @@ static void rose_heartbeat_expiry(struct timer_list *t)
122
122
struct rose_sock * rose = rose_sk (sk );
123
123
124
124
bh_lock_sock (sk );
125
+ if (sock_owned_by_user (sk )) {
126
+ sk_reset_timer (sk , & sk -> sk_timer , jiffies + HZ /20 );
127
+ goto out ;
128
+ }
125
129
switch (rose -> state ) {
126
130
case ROSE_STATE_0 :
127
131
/* Magic here: If we listen() and a new link dies before it
@@ -152,6 +156,7 @@ static void rose_heartbeat_expiry(struct timer_list *t)
152
156
}
153
157
154
158
rose_start_heartbeat (sk );
159
+ out :
155
160
bh_unlock_sock (sk );
156
161
sock_put (sk );
157
162
}
@@ -162,6 +167,10 @@ static void rose_timer_expiry(struct timer_list *t)
162
167
struct sock * sk = & rose -> sock ;
163
168
164
169
bh_lock_sock (sk );
170
+ if (sock_owned_by_user (sk )) {
171
+ sk_reset_timer (sk , & rose -> timer , jiffies + HZ /20 );
172
+ goto out ;
173
+ }
165
174
switch (rose -> state ) {
166
175
case ROSE_STATE_1 : /* T1 */
167
176
case ROSE_STATE_4 : /* T2 */
@@ -182,6 +191,7 @@ static void rose_timer_expiry(struct timer_list *t)
182
191
}
183
192
break ;
184
193
}
194
+ out :
185
195
bh_unlock_sock (sk );
186
196
sock_put (sk );
187
197
}
@@ -192,6 +202,10 @@ static void rose_idletimer_expiry(struct timer_list *t)
192
202
struct sock * sk = & rose -> sock ;
193
203
194
204
bh_lock_sock (sk );
205
+ if (sock_owned_by_user (sk )) {
206
+ sk_reset_timer (sk , & rose -> idletimer , jiffies + HZ /20 );
207
+ goto out ;
208
+ }
195
209
rose_clear_queues (sk );
196
210
197
211
rose_write_internal (sk , ROSE_CLEAR_REQUEST );
@@ -207,6 +221,7 @@ static void rose_idletimer_expiry(struct timer_list *t)
207
221
sk -> sk_state_change (sk );
208
222
sock_set_flag (sk , SOCK_DEAD );
209
223
}
224
+ out :
210
225
bh_unlock_sock (sk );
211
226
sock_put (sk );
212
227
}
0 commit comments