aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/xdr4.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-09-28 10:18:39 -0400
committerThomas Gleixner <tglx@linutronix.de>2010-10-12 10:53:37 -0400
commitd0fbca8f9304d1760fdc906b35b06e89fbdbb51f (patch)
tree4f831294a9cd4d2f46298c45fccfc57a942f04f0 /fs/lockd/xdr4.c
parent90297c5fe71d32a2a0ead38bd8f6b1112a2e5ac0 (diff)
x86: ioapic/hpet: Convert to new chip functions
Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/lockd/xdr4.c')
0 files changed, 0 insertions, 0 deletions
or Linus Torvalds <torvalds@ppc970.osdl.org> 2005-04-16 18:20:36 -0400 committer Linus Torvalds <torvalds@ppc970.osdl.org> 2005-04-16 18:20:36 -0400 Linux-2.6.12-rc2' href='/cgit/cgit.cgi/litmus-rt-ext-res.git/commit/net/ipv4/tcp_minisocks.c?id=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2'>1da177e4c3f4
e905a9edab7f
1da177e4c3f4



























8feaf0c0a548

1da177e4c3f4

cf533ea53ebf
4957faade11b
a2a385d627e1
1da177e4c3f4
bb5b7c11263d
8feaf0c0a548
2100c8d2d9db
1da177e4c3f4

8feaf0c0a548

c887e6d2d9ae
1da177e4c3f4








8feaf0c0a548

1da177e4c3f4




8feaf0c0a548
1da177e4c3f4


1ac530b3553e

1da177e4c3f4
8feaf0c0a548
1da177e4c3f4






8feaf0c0a548
1da177e4c3f4
295ff7edb8f7
8feaf0c0a548
1da177e4c3f4



8feaf0c0a548

1da177e4c3f4
9d729f72dca9
8feaf0c0a548
1da177e4c3f4

ccb7c410ddc0


696ab2d3bffc

1da177e4c3f4
696ab2d3bffc

1da177e4c3f4









e905a9edab7f
1da177e4c3f4




e905a9edab7f
1da177e4c3f4



8feaf0c0a548
1da177e4c3f4



caa20d9abe81
1da177e4c3f4




295ff7edb8f7
8feaf0c0a548
1da177e4c3f4


696ab2d3bffc

1da177e4c3f4

8feaf0c0a548
9d729f72dca9
1da177e4c3f4

8feaf0c0a548
1da177e4c3f4




















8feaf0c0a548



1da177e4c3f4






de0744af1fe2
1da177e4c3f4
2de979bd7da9
1da177e4c3f4






696ab2d3bffc

1da177e4c3f4





8feaf0c0a548
1da177e4c3f4

4bc2f18ba4f2
1da177e4c3f4
e905a9edab7f
1da177e4c3f4
e905a9edab7f
1da177e4c3f4

8feaf0c0a548
8292a17a399f
8feaf0c0a548
a2a385d627e1
1da177e4c3f4
b6242b9b45e8
3f419d2d4878
1da177e4c3f4
295ff7edb8f7
c676270bcd25
1da177e4c3f4
8feaf0c0a548

463c84b97f24
2397849baa7c
8feaf0c0a548
2397849baa7c
1da177e4c3f4
8feaf0c0a548




1da177e4c3f4
dfd56b8b38ff
1da177e4c3f4

0fa1a53e1f05
1da177e4c3f4
0fa1a53e1f05

4e3fd7a06dc2

b903d324bee2
8feaf0c0a548
c676270bcd25
1da177e4c3f4
cfb6eeb4c860









a915da9b6927
cfb6eeb4c860

a915da9b6927

cfb6eeb4c860

2de979bd7da9
cfb6eeb4c860

1da177e4c3f4
e48c414ee61f
1da177e4c3f4












696ab2d3bffc

8feaf0c0a548
1da177e4c3f4




67631510a318
1da177e4c3f4





cfb6eeb4c860

b6242b9b45e8
a928630a2ffe
2397849baa7c
a915da9b6927
657e9649e745
a915da9b6927

cfb6eeb4c860

cfb6eeb4c860

bdf1ee5d3bd3





1da177e4c3f4





60236fdd08b2
1da177e4c3f4
e56c57d0d3fd
1da177e4c3f4
87d11ceb9deb
9f1d2604c714
2e6599cb899b
a9948a7e1501
435cf559f02e


























1da177e4c3f4
1da177e4c3f4
1da177e4c3f4
435cf559f02e






1da177e4c3f4

46d3ceabd8d9
1da177e4c3f4
ee7537b63a28
1da177e4c3f4
1da177e4c3f4

463c84b97f24
1da177e4c3f4

1da177e4c3f4


0b6a05c1dbeb
eed530b6c676
1da177e4c3f4





9ad7c049f0f7
1da177e4c3f4
9772efb97078
1da177e4c3f4



d8a6e65f8b6b


317a76f9a44b
6687e988d9ae
1da177e4c3f4

435cf559f02e

1da177e4c3f4



1da177e4c3f4
cabeccbd172c
1da177e4c3f4
1da177e4c3f4
1da177e4c3f4
463c84b97f24

1da177e4c3f4
2e6599cb899b
2de979bd7da9
1da177e4c3f4
e60402d0a909
1da177e4c3f4



2e6599cb899b
1da177e4c3f4
2e6599cb899b

1da177e4c3f4



aa8223c7bb0b

1da177e4c3f4



9d729f72dca9
1da177e4c3f4




cfb6eeb4c860




bee7ca9ec03a
463c84b97f24
1da177e4c3f4

1da177e4c3f4
63231bddf651
1da177e4c3f4


4bc2f18ba4f2
1da177e4c3f4
e905a9edab7f
1da177e4c3f4
60236fdd08b2
1da177e4c3f4

5a5f3a8db9d7
60236fdd08b2

1da177e4c3f4
4957faade11b
cf533ea53ebf
4957faade11b
aa8223c7bb0b
714e85be3557
a2a385d627e1
1da177e4c3f4
bb5b7c11263d

2100c8d2d9db
1da177e4c3f4






9d729f72dca9
c887e6d2d9ae
1da177e4c3f4



2e6599cb899b
1da177e4c3f4


















e6b4d1136751
1da177e4c3f4































ec0a196626bd



1da177e4c3f4















caa20d9abe81
1da177e4c3f4




435cf559f02e

1da177e4c3f4









2e6599cb899b
1da177e4c3f4

6edafaaf6f5e
1da177e4c3f4
de0744af1fe2
1da177e4c3f4




2e6599cb899b
2aaab9a0ccfd
1da177e4c3f4
2aaab9a0ccfd




1da177e4c3f4
2aaab9a0ccfd






1da177e4c3f4
2aaab9a0ccfd




ec0a196626bd
d1b99ba41d6c

2aaab9a0ccfd

907cdda5205b
2aaab9a0ccfd

9ad7c049f0f7



2aaab9a0ccfd









1da177e4c3f4
2aaab9a0ccfd

1da177e4c3f4
2aaab9a0ccfd

1da177e4c3f4
2aaab9a0ccfd




1da177e4c3f4
2aaab9a0ccfd



1da177e4c3f4
2aaab9a0ccfd

1da177e4c3f4
4bc2f18ba4f2
1da177e4c3f4













aa8223c7bb0b

1da177e4c3f4







a3a858ff18a7
1da177e4c3f4





1da177e4c3f4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748






                                                                            
                         











                                                                

                         
                       





                            
                                            

                                     
                                               
 


                                                                    
                                                                         



                                                                           
                                                                    





                                                                           

                                 
                                                                     

                         
                            
                                                        
                            
                                              

 
  



























                                                                              

                                                                              

                                            
                                
                                                                      
                                 
 
                               
                                                                         
                                                                          

                                         

                                                                            
                                                                         








                                                                                  

                                                                          




                                          
                                                                                


                                           

                                                                          
                                                                       
                                          






                                                                               
                                                                        
              
                                                                 
                                          



                                                              

                                                             
                                         
                                                                  
                                                                      

                 


                                                      

                                                                              
                    

                                                                                









                                                                    
          




                                                                      
                                                                    



                                        
                                                         



                                                                              
                                                                           




                                                                              
                                                                         
                                                  


                                                      

                                                                        

                                         
                                                                      
                                                                  

                 
                                  




















                                                                            



                                                                     






                                            
                                                                            
 
                       






                                                                         

                                                                                





                                                            
                          

                              
                                          
 
  
                                                       
   

                                                         
                                             
                                                               
                                               
                                
 
                                                                          
                                                    
 
                                                                         
                                                
 

                                                                              
                                                                              
                                                     
 
                                                            
                                                                




                                                                       
 
                           

                                                             
                                                        
 

                                                                          

                                                             
                                                   
                                                       
                 
      









                                                                        
                                                 

                                                                  

                                                                                           

                                              
                            

      
                                      
                                                             












                                                          

                                                             
                                  




                                                                 
                                                                              





                               

                                         
                        
                                                      
 
                               
                                       

                                                 

      

                                       





                                                                  





                                                                          
                                                                                                     
 
                                                                      
 
                            
                                                                     
                                                             
                                                                       


























                                                                             
 
                                        
                                      






                                                                   

                                         
                                                 
 
                                                  
 

                                               
                                                     

                                       


                                       
                                                            
                                                





                                                                                
                                                
                                        
                                       



                                         


                                                                        
 
                                                     

                                                                

                                                                   



                                             
                                            
 
                                    
 
                                                    

                                                                                   
 
                                                          
                                                                   
                                            
                                                       



                                                        
                                                          
                                              

                                                                    



                                                                                

                                                                



                                                                 
                                                                      




                                                                                               




                                                                        
                                                                        
                                                                                           

                                                   
 
                                                                     


                     
                                        
 
  
                                                                   
                          

   
                                                                

                                                      
 
                                            
                                
                           
                                               
                                                                                  
                                 
 

                                                    
                                                                          






                                                                              
                                                                                                        
                                                                         



                                               
                                                            


















                                                                      
                                                         































                                                                             



                                                                              















                                                                                   
                                                                              




                                                              

                                                                      









                                                                                         
                                                                                                                 

                                                       
                                                             
                                
                                                                                    




                                      
                                                                                          
                                                   
 




                                                             
 






                                                                     
 




                                                               
 

                                                                               

                                                                    
                                                                             

                            



                                                                            









                                                                             
 

                                                   
 

                                                 
 




                                            
 



                                                                
 

                                                 
 
                             













                                                               

                                                                     







                                                                      
                                             





                              
                                 
/*
 * INET		An implementation of the TCP/IP protocol suite for the LINUX
 *		operating system.  INET is implemented using the  BSD Socket
 *		interface as the means of communication with the user level.
 *
 *		Implementation of the Transmission Control Protocol(TCP).
 *
 * Authors:	Ross Biro
 *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
 *		Mark Evans, <evansmp@uhura.aston.ac.uk>
 *		Corey Minyard <wf-rch!minyard@relay.EU.net>
 *		Florian La Roche, <flla@stud.uni-sb.de>
 *		Charles Hedrick, <hedrick@klinzhai.rutgers.edu>
 *		Linus Torvalds, <torvalds@cs.helsinki.fi>
 *		Alan Cox, <gw4pts@gw4pts.ampr.org>
 *		Matthew Dillon, <dillon@apollo.west.oic.com>
 *		Arnt Gulbrandsen, <agulbra@nvg.unit.no>
 *		Jorge Cwik, <jorge@laser.satlink.net>
 */

#include <linux/mm.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/sysctl.h>
#include <linux/workqueue.h>
#include <net/tcp.h>
#include <net/inet_common.h>
#include <net/xfrm.h>

int sysctl_tcp_syncookies __read_mostly = 1;
EXPORT_SYMBOL(sysctl_tcp_syncookies);

int sysctl_tcp_abort_on_overflow __read_mostly;

struct inet_timewait_death_row tcp_death_row = {
	.sysctl_max_tw_buckets = NR_FILE * 2,
	.period		= TCP_TIMEWAIT_LEN / INET_TWDR_TWKILL_SLOTS,
	.death_lock	= __SPIN_LOCK_UNLOCKED(tcp_death_row.death_lock),
	.hashinfo	= &tcp_hashinfo,
	.tw_timer	= TIMER_INITIALIZER(inet_twdr_hangman, 0,
					    (unsigned long)&tcp_death_row),
	.twkill_work	= __WORK_INITIALIZER(tcp_death_row.twkill_work,
					     inet_twdr_twkill_work),
/* Short-time timewait calendar */

	.twcal_hand	= -1,
	.twcal_timer	= TIMER_INITIALIZER(inet_twdr_twcal_tick, 0,
					    (unsigned long)&tcp_death_row),
};
EXPORT_SYMBOL_GPL(tcp_death_row);

static bool tcp_in_window(u32 seq, u32 end_seq, u32 s_win, u32 e_win)
{
	if (seq == s_win)
		return true;
	if (after(end_seq, s_win) && before(seq, e_win))
		return true;
	return seq == e_win && seq == end_seq;
}

/*
 * * Main purpose of TIME-WAIT state is to close connection gracefully,
 *   when one of ends sits in LAST-ACK or CLOSING retransmitting FIN
 *   (and, probably, tail of data) and one or more our ACKs are lost.
 * * What is TIME-WAIT timeout? It is associated with maximal packet
 *   lifetime in the internet, which results in wrong conclusion, that
 *   it is set to catch "old duplicate segments" wandering out of their path.
 *   It is not quite correct. This timeout is calculated so that it exceeds
 *   maximal retransmission timeout enough to allow to lose one (or more)
 *   segments sent by peer and our ACKs. This time may be calculated from RTO.
 * * When TIME-WAIT socket receives RST, it means that another end
 *   finally closed and we are allowed to kill TIME-WAIT too.
 * * Second purpose of TIME-WAIT is catching old duplicate segments.
 *   Well, certainly it is pure paranoia, but if we load TIME-WAIT
 *   with this semantics, we MUST NOT kill TIME-WAIT state with RSTs.
 * * If we invented some more clever way to catch duplicates
 *   (f.e. based on PAWS), we could truncate TIME-WAIT to several RTOs.
 *
 * The algorithm below is based on FORMAL INTERPRETATION of RFCs.
 * When you compare it to RFCs, please, read section SEGMENT ARRIVES
 * from the very beginning.
 *
 * NOTE. With recycling (and later with fin-wait-2) TW bucket
 * is _not_ stateless. It means, that strictly speaking we must
 * spinlock it. I do not want! Well, probability of misbehaviour
 * is ridiculously low and, seems, we could use some mb() tricks
 * to avoid misread sequence numbers, states etc.  --ANK
 */
enum tcp_tw_status
tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb,
			   const struct tcphdr *th)
{
	struct tcp_options_received tmp_opt;
	const u8 *hash_location;
	struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw);
	bool paws_reject = false;

	tmp_opt.saw_tstamp = 0;
	if (th->doff > (sizeof(*th) >> 2) && tcptw->tw_ts_recent_stamp) {
		tcp_parse_options(skb, &tmp_opt, &hash_location, 0, NULL);

		if (tmp_opt.saw_tstamp) {
			tmp_opt.ts_recent	= tcptw->tw_ts_recent;
			tmp_opt.ts_recent_stamp	= tcptw->tw_ts_recent_stamp;
			paws_reject = tcp_paws_reject(&tmp_opt, th->rst);
		}
	}

	if (tw->tw_substate == TCP_FIN_WAIT2) {
		/* Just repeat all the checks of tcp_rcv_state_process() */

		/* Out of window, send ACK */
		if (paws_reject ||
		    !tcp_in_window(TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq,
				   tcptw->tw_rcv_nxt,
				   tcptw->tw_rcv_nxt + tcptw->tw_rcv_wnd))
			return TCP_TW_ACK;

		if (th->rst)
			goto kill;

		if (th->syn && !before(TCP_SKB_CB(skb)->seq, tcptw->tw_rcv_nxt))
			goto kill_with_rst;

		/* Dup ACK? */
		if (!th->ack ||
		    !after(TCP_SKB_CB(skb)->end_seq, tcptw->tw_rcv_nxt) ||
		    TCP_SKB_CB(skb)->end_seq == TCP_SKB_CB(skb)->seq) {
			inet_twsk_put(tw);
			return TCP_TW_SUCCESS;
		}

		/* New data or FIN. If new data arrive after half-duplex close,
		 * reset.
		 */
		if (!th->fin ||
		    TCP_SKB_CB(skb)->end_seq != tcptw->tw_rcv_nxt + 1) {
kill_with_rst:
			inet_twsk_deschedule(tw, &tcp_death_row);
			inet_twsk_put(tw);
			return TCP_TW_RST;
		}

		/* FIN arrived, enter true time-wait state. */
		tw->tw_substate	  = TCP_TIME_WAIT;
		tcptw->tw_rcv_nxt = TCP_SKB_CB(skb)->end_seq;
		if (tmp_opt.saw_tstamp) {
			tcptw->tw_ts_recent_stamp = get_seconds();
			tcptw->tw_ts_recent	  = tmp_opt.rcv_tsval;
		}

		if (tcp_death_row.sysctl_tw_recycle &&
		    tcptw->tw_ts_recent_stamp &&
		    tcp_tw_remember_stamp(tw))
			inet_twsk_schedule(tw, &tcp_death_row, tw->tw_timeout,
					   TCP_TIMEWAIT_LEN);
		else
			inet_twsk_schedule(tw, &tcp_death_row, TCP_TIMEWAIT_LEN,
					   TCP_TIMEWAIT_LEN);
		return TCP_TW_ACK;
	}

	/*
	 *	Now real TIME-WAIT state.
	 *
	 *	RFC 1122:
	 *	"When a connection is [...] on TIME-WAIT state [...]
	 *	[a TCP] MAY accept a new SYN from the remote TCP to
	 *	reopen the connection directly, if it:
	 *
	 *	(1)  assigns its initial sequence number for the new
	 *	connection to be larger than the largest sequence
	 *	number it used on the previous connection incarnation,
	 *	and
	 *
	 *	(2)  returns to TIME-WAIT state if the SYN turns out
	 *	to be an old duplicate".
	 */

	if (!paws_reject &&
	    (TCP_SKB_CB(skb)->seq == tcptw->tw_rcv_nxt &&
	     (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq || th->rst))) {
		/* In window segment, it may be only reset or bare ack. */

		if (th->rst) {
			/* This is TIME_WAIT assassination, in two flavors.
			 * Oh well... nobody has a sufficient solution to this
			 * protocol bug yet.
			 */
			if (sysctl_tcp_rfc1337 == 0) {
kill: