-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlustre-2.4.patch
1701 lines (1641 loc) · 71.5 KB
/
lustre-2.4.patch
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
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Binary files lustre_backup/.aclocal.m4.swp and lustre-release/.aclocal.m4.swp differ
diff -urN lustre_backup/ldiskfs/kernel_patches/patches/rhel6.4/ext4-rat.patch lustre-release/ldiskfs/kernel_patches/patches/rhel6.4/ext4-rat.patch
--- lustre_backup/ldiskfs/kernel_patches/patches/rhel6.4/ext4-rat.patch 1969-12-31 18:00:00.000000000 -0600
+++ lustre-release/ldiskfs/kernel_patches/patches/rhel6.4/ext4-rat.patch 2014-01-28 16:09:14.918208367 -0600
@@ -0,0 +1,134 @@
+===================================================================
+--- linux-stage.orig/fs/ext4/super.c
++++ linux-stage/fs/ext4/super.c
+@@ -347,15 +347,33 @@
+ sb->s_id);
+ }
+
++#define CONFIG_VPRINK2
++static inline void ext4_vprintk2(const char *fmt1, const char *fmt2, va_list args2, ...)
++{
++ va_list args1;
++ va_start(args1, args2);
++
++#if defined(CONFIG_VPRINTK2)
++ int vprintk2(const char *fmt1, va_list args1,
++ const char *fmt2, va_list args2);
++ vprintk2(fmt1, args1, fmt2, args2);
++#else
++ vprintk(fmt1,args1);
++ vprintk(fmt2,args2);
++#endif
++
++ va_end(args1);
++}
++
+ void __ext4_error(struct super_block *sb, const char *function,
+ const char *fmt, ...)
+ {
+ va_list args;
+
+ va_start(args, fmt);
+- printk(KERN_CRIT "EXT4-fs error (device %s): %s: ", sb->s_id, function);
+- vprintk(fmt, args);
+- printk("\n");
++
++ ext4_vprintk2(KERN_CRIT "EXT4-fs error (device %s): %s: ",
++ fmt, args, sb->s_id, function);
+ va_end(args);
+
+ ext4_handle_error(sb);
+@@ -367,10 +385,9 @@
+ va_list args;
+
+ va_start(args, fmt);
+- printk(KERN_CRIT "EXT4-fs error (device %s): %s: inode #%lu: (comm %s) ",
+- inode->i_sb->s_id, function, inode->i_ino, current->comm);
+- vprintk(fmt, args);
+- printk("\n");
++
++ ext4_vprintk2(KERN_CRIT "EXT4-fs error (device %s): %s: inode #%lu: (comm %s) ", fmt, args, inode->i_sb->s_id, function, inode->i_ino, current->comm);
++
+ va_end(args);
+
+ ext4_handle_error(inode->i_sb);
+@@ -387,11 +404,9 @@
+ path = d_path(&(file->f_path), pathname, sizeof(pathname));
+ if (!path)
+ path = "(unknown)";
+- printk(KERN_CRIT
+- "EXT4-fs error (device %s): %s: inode #%lu (comm %s path %s): ",
+- inode->i_sb->s_id, function, inode->i_ino, current->comm, path);
+- vprintk(fmt, args);
+- printk("\n");
++
++ ext4_vprintk2(KERN_CRIT "EXT4-fs error (device %s): %s: inode #%lu (comm %s path %s): ", fmt, args, inode->i_sb->s_id, function, inode->i_ino, current->comm, path);
++
+ va_end(args);
+
+ ext4_handle_error(inode->i_sb);
+@@ -469,9 +484,9 @@
+ va_list args;
+
+ va_start(args, fmt);
+- printk(KERN_CRIT "EXT4-fs error (device %s): %s: ", sb->s_id, function);
+- vprintk(fmt, args);
+- printk("\n");
++
++ ext4_vprintk2(KERN_CRIT "EXT4-fs error (device %s): %s: ", fmt, args, sb->s_id, function);
++
+ va_end(args);
+
+ if (test_opt(sb, ERRORS_PANIC))
+@@ -491,13 +506,11 @@
+ void ext4_msg (struct super_block * sb, const char *prefix,
+ const char *fmt, ...)
+ {
+- va_list args;
++ va_list args;
++ va_start(args, fmt);
+
+- va_start(args, fmt);
+- printk("%sEXT4-fs (%s): ", prefix, sb->s_id);
+- vprintk(fmt, args);
+- printk("\n");
+- va_end(args);
++ ext4_vprintk2("%sEXT4-fs (%s): ", fmt, args, prefix, sb->s_id);
++ va_end(args);
+ }
+
+ void __ext4_warning(struct super_block *sb, const char *function,
+@@ -506,10 +519,10 @@
+ va_list args;
+
+ va_start(args, fmt);
+- printk(KERN_WARNING "EXT4-fs warning (device %s): %s: ",
+- sb->s_id, function);
+- vprintk(fmt, args);
+- printk("\n");
++
++ ext4_vprintk2(KERN_WARNING "EXT4-fs warning (device %s): %s: ",
++ fmt, args, sb->s_id, function);
++
+ va_end(args);
+ }
+
+@@ -522,9 +535,10 @@
+ struct ext4_super_block *es = EXT4_SB(sb)->s_es;
+
+ va_start(args, fmt);
+- printk(KERN_CRIT "EXT4-fs error (device %s): %s: ", sb->s_id, function);
+- vprintk(fmt, args);
+- printk("\n");
++
++ ext4_vprintk2(KERN_CRIT "EXT4-fs error (device %s): %s: ",
++ fmt, args, sb->s_id, function);
++
+ va_end(args);
+
+ if (test_opt(sb, ERRORS_CONT)) {
+
+
+
+
+
diff -urN lustre_backup/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series lustre-release/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series
--- lustre_backup/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series 2013-12-17 13:20:46.148185705 -0600
+++ lustre-release/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series 2014-01-23 16:15:01.881241010 -0600
@@ -13,6 +13,7 @@
rhel6.4/ext4-prealloc.patch
rhel6.3/ext4-mballoc-extra-checks.patch
rhel6.4/ext4-misc.patch
+rhel6.4/ext4-rat.patch
rhel6.3/ext4-big-endian-check-2.6.patch
rhel6.3/ext4-alloc-policy-2.6.patch
rhel6.3/ext4-force_over_128tb.patch
diff -urN lustre_backup/libcfs/include/libcfs/libcfs_debug.h lustre-release/libcfs/include/libcfs/libcfs_debug.h
--- lustre_backup/libcfs/include/libcfs/libcfs_debug.h 2013-12-17 13:20:46.150186706 -0600
+++ lustre-release/libcfs/include/libcfs/libcfs_debug.h 2014-01-06 10:56:30.405424723 -0600
@@ -165,6 +165,7 @@
#define CDEBUG_DEFAULT_MAX_DELAY (cfs_time_seconds(600)) /* jiffies */
#define CDEBUG_DEFAULT_MIN_DELAY ((cfs_time_seconds(1) + 1) / 2) /* jiffies */
#define CDEBUG_DEFAULT_BACKOFF 2
+
typedef struct {
cfs_time_t cdls_next;
unsigned int cdls_delay;
@@ -181,7 +182,7 @@
};
#define LIBCFS_DEBUG_MSG_DATA_INIT(data, mask, cdls) \
-do { \
+do { \
(data)->msg_subsys = DEBUG_SUBSYSTEM; \
(data)->msg_file = __FILE__; \
(data)->msg_fn = __FUNCTION__; \
@@ -199,6 +200,55 @@
.msg_cdls = (cdls) }; \
dataname.msg_mask = (mask);
+
+static inline const char *cfs_debug_prio(int mask)
+{
+#if defined(__KERNEL__) && defined(__linux__)
+ if (mask & D_EMERG)
+ return KERN_EMERG;
+ else if (mask & D_ERROR)
+ return KERN_ERR;
+ else if (mask & D_WARNING)
+ return KERN_WARNING;
+ else if (mask & D_INFO)
+ return KERN_INFO;
+ else
+ return KERN_DEBUG;
+#else
+ return "";
+#endif
+}
+
+static inline int cfs_current_pid(void)
+{
+#if defined(__KERNEL__) && defined(__linux__)
+ return current->pid;
+#else
+ return 0;
+#endif
+}
+
+__attribute__((pure))
+static inline const char *cfs_basename(const char *path)
+{
+ const char *slash = strrchr(path, '/');
+ if (slash != NULL)
+ return slash + 1;
+ return path;
+}
+
+#define CFS_DEBUG_MASK(mask) \
+ (((mask) & D_CANTMASK) != 0 || \
+ ((libcfs_debug & (mask)) != 0 && \
+ (libcfs_subsystem_debug & DEBUG_SUBSYSTEM) != 0))
+
+#define CFS_DEBUG_HDR_FMT "%sLustre: %d:(%s:%d:%s()) "
+
+#define CFS_DEBUG_ARGS(cdls, mask, fmt, args...) \
+ cdls, DEBUG_SUBSYSTEM, mask, CFS_DEBUG_HDR_FMT fmt, \
+ cfs_debug_prio(mask), cfs_current_pid(), \
+ cfs_basename(__FILE__), __LINE__, __FUNCTION__, ##args
+
#if defined(__KERNEL__) || (defined(__arch_lib__) && !defined(LUSTRE_UTILS))
#ifdef CDEBUG_ENABLED
@@ -209,31 +259,30 @@
static inline int cfs_cdebug_show(unsigned int mask, unsigned int subsystem)
{
return mask & D_CANTMASK ||
- ((libcfs_debug & mask) && (libcfs_subsystem_debug & subsystem));
+ ((libcfs_debug & mask) && (libcfs_subsystem_debug & subsystem));
}
-#define __CDEBUG(cdls, mask, format, ...) \
-do { \
- static struct libcfs_debug_msg_data msgdata; \
- \
- CFS_CHECK_STACK(&msgdata, mask, cdls); \
- \
- if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) { \
- LIBCFS_DEBUG_MSG_DATA_INIT(&msgdata, mask, cdls); \
- libcfs_debug_msg(&msgdata, format, ## __VA_ARGS__); \
- } \
-} while (0)
+#define __CDEBUG(cdls, mask, fmt, ...) \
+ do { \
+ static struct libcfs_debug_msg_data msgdata; \
+ \
+ if (CFS_DEBUG_MASK((mask))) { \
+ LIBCFS_DEBUG_MSG_DATA_INIT(&msgdata, mask, cdls); \
+ libcfs_debug_msg(&msgdata, CFS_DEBUG_HDR_FMT fmt, cfs_debug_prio(mask), cfs_current_pid(), cfs_basename(__FILE__), __LINE__, __FUNCTION__, ## __VA_ARGS__); \
+ } \
+ } while (0)
#define CDEBUG(mask, format, ...) __CDEBUG(NULL, mask, format, ## __VA_ARGS__)
-#define CDEBUG_LIMIT(mask, format, ...) \
-do { \
- static cfs_debug_limit_state_t cdls; \
- \
- __CDEBUG(&cdls, mask, format, ## __VA_ARGS__);\
-} while (0)
+#define CDEBUG_LIMIT(mask, format, ...) \
+ do { \
+ static cfs_debug_limit_state_t cdls; \
+ \
+ __CDEBUG(&cdls, mask, format, ## __VA_ARGS__); \
+ } while (0)
#else /* !CDEBUG_ENABLED */
+
static inline int cfs_cdebug_show(unsigned int mask, unsigned int subsystem)
{
return 0;
@@ -370,12 +419,12 @@
extern int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
const char *format1, ...)
- __attribute__ ((format (printf, 2, 3)));
+ __attribute__ ((format (printf, 2, 3)));
-extern int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
- const char *format1,
- va_list args, const char *format2, ...)
- __attribute__ ((format (printf, 4, 5)));
+extern int libcfs_debug_msg2(struct libcfs_debug_msg_data *msgdata,
+ const char *format1,
+ va_list args, const char *format2, ...)
+ __attribute__ ((format (printf, 4, 5)));
/* other external symbols that tracefile provides: */
extern int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob,
diff -urN lustre_backup/libcfs/include/libcfs/libcfs_private.h lustre-release/libcfs/include/libcfs/libcfs_private.h
--- lustre_backup/libcfs/include/libcfs/libcfs_private.h 2013-12-17 13:20:46.152187704 -0600
+++ lustre-release/libcfs/include/libcfs/libcfs_private.h 2013-12-18 16:04:16.520703436 -0600
@@ -58,9 +58,7 @@
* of equality check, but doesn't have unlikely(). Turn this on from time to
* time to make test-builds. This shouldn't be on for production release.
*/
-#define LASSERT_CHECKED (0)
-#if LASSERT_CHECKED
/*
* Assertion.
*
@@ -71,36 +69,22 @@
*
* requires -Wall. Unfortunately this rules out use of likely/unlikely.
*/
-#define LASSERTF(cond, fmt, ...) \
-do { \
- if (cond) \
- ; \
- else { \
- LIBCFS_DEBUG_MSG_DATA_DECL(__msg_data, D_EMERG, NULL); \
- libcfs_debug_msg(&__msg_data, \
- "ASSERTION( %s ) failed: " fmt, #cond, \
- ## __VA_ARGS__); \
- lbug_with_loc(&__msg_data); \
- } \
-} while (0)
-
-#define LASSERT(cond) LASSERTF(cond, "\n")
-
-#else /* !LASSERT_CHECKED */
+#if 0
+#define LASSERT_CHECK(cond) if (cond) /* OK. */; else
+#else
+#define LASSERT_CHECK(cond) if (unlikely(!(cond)))
+#endif
-#define LASSERTF(cond, fmt, ...) \
-do { \
- if (unlikely(!(cond))) { \
- LIBCFS_DEBUG_MSG_DATA_DECL(__msg_data, D_EMERG, NULL); \
- libcfs_debug_msg(&__msg_data, \
- "ASSERTION( %s ) failed: " fmt, #cond, \
- ## __VA_ARGS__); \
- lbug_with_loc(&__msg_data); \
- } \
-} while (0)
+#define LASSERTF(cond, fmt, ...) \
+({ \
+ LASSERT_CHECK(cond) { \
+ CEMERG("ASSERTION(%s) failed: " fmt, #cond, ## __VA_ARGS__); \
+ LBUG(); \
+ } \
+ })
#define LASSERT(cond) LASSERTF(cond, "\n")
-#endif /* !LASSERT_CHECKED */
+
#else /* !LIBCFS_DEBUG */
/* sizeof is to use expression without evaluating it. */
# define LASSERT(e) ((void)sizeof!!(e))
@@ -122,11 +106,11 @@
void lbug_with_loc(struct libcfs_debug_msg_data *) __attribute__((noreturn));
-#define LBUG() \
-do { \
+#define LBUG() \
+do { \
LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_EMERG, NULL); \
lbug_with_loc(&msgdata); \
-} while(0)
+} while (0)
extern cfs_atomic_t libcfs_kmemory;
/*
diff -urN lustre_backup/libcfs/include/libcfs/libcfs_time.h lustre-release/libcfs/include/libcfs/libcfs_time.h
--- lustre_backup/libcfs/include/libcfs/libcfs_time.h 2013-12-17 13:20:46.153188203 -0600
+++ lustre-release/libcfs/include/libcfs/libcfs_time.h 2013-12-17 13:45:22.087786697 -0600
@@ -90,23 +90,6 @@
cfs_duration_sec(cfs_time_sub(cfs_time_current(),now)));
}
-#define CFS_RATELIMIT(seconds) \
-({ \
- /* \
- * XXX nikita: non-portable initializer \
- */ \
- static time_t __next_message = 0; \
- int result; \
- \
- if (cfs_time_after(cfs_time_current(), __next_message)) \
- result = 1; \
- else { \
- __next_message = cfs_time_shift(seconds); \
- result = 0; \
- } \
- result; \
-})
-
/*
* helper function similar to do_gettimeofday() of Linux kernel
*/
diff -urN lustre_backup/libcfs/libcfs/debug.c lustre-release/libcfs/libcfs/debug.c
--- lustre_backup/libcfs/libcfs/debug.c 2013-12-17 13:20:46.165194204 -0600
+++ lustre-release/libcfs/libcfs/debug.c 2013-12-19 11:18:35.094633777 -0600
@@ -473,4 +473,5 @@
libcfs_debug_msg(msgdata, "Process leaving via %s (rc=" LPLU " : " LPLD
" : " LPLX ")\n", label, (ulong_ptr_t)rc, rc, rc);
}
+
EXPORT_SYMBOL(libcfs_log_goto);
Binary files lustre_backup/libcfs/libcfs/libcfs.ko.unsigned and lustre-release/libcfs/libcfs/libcfs.ko.unsigned differ
diff -urN lustre_backup/libcfs/libcfs/linux/linux-debug.c lustre-release/libcfs/libcfs/linux/linux-debug.c
--- lustre_backup/libcfs/libcfs/linux/linux-debug.c 2013-12-17 13:20:46.166194705 -0600
+++ lustre-release/libcfs/libcfs/linux/linux-debug.c 2013-12-18 12:51:29.411038980 -0600
@@ -164,7 +164,6 @@
void lbug_with_loc(struct libcfs_debug_msg_data *msgdata)
{
libcfs_catastrophe = 1;
- libcfs_debug_msg(msgdata, "LBUG\n");
if (in_interrupt()) {
panic("LBUG in interrupt.\n");
diff -urN lustre_backup/libcfs/libcfs/posix/posix-debug.c lustre-release/libcfs/libcfs/posix/posix-debug.c
--- lustre_backup/libcfs/libcfs/posix/posix-debug.c 2013-12-17 13:20:46.171197204 -0600
+++ lustre-release/libcfs/libcfs/posix/posix-debug.c 2013-12-19 11:19:27.356633780 -0600
@@ -160,14 +160,14 @@
int rc;
va_start(args, format);
- rc = libcfs_debug_vmsg2(msgdata, format, args, NULL);
+ rc = libcfs_debug_msg2(msgdata, format, args, NULL);
va_end(args);
return rc;
}
int
-libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
+libcfs_debug_msg2(struct libcfs_debug_msg_data *msgdata,
const char *format1, va_list args,
const char *format2, ...)
{
Binary files lustre_backup/libcfs/libcfs/.tmp_libcfs_mem.o and lustre-release/libcfs/libcfs/.tmp_libcfs_mem.o differ
diff -urN lustre_backup/libcfs/libcfs/tracefile.c lustre-release/libcfs/libcfs/tracefile.c
--- lustre_backup/libcfs/libcfs/tracefile.c 2013-12-17 13:20:46.173198204 -0600
+++ lustre-release/libcfs/libcfs/tracefile.c 2014-01-06 13:47:42.493858556 -0600
@@ -244,65 +244,39 @@
return tage;
}
-int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
- const char *format, ...)
-{
- va_list args;
- int rc;
-
- va_start(args, format);
- rc = libcfs_debug_vmsg2(msgdata, format, args, NULL);
- va_end(args);
-
- return rc;
-}
-EXPORT_SYMBOL(libcfs_debug_msg);
-
-int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
- const char *format1, va_list args,
- const char *format2, ...)
+static void trace_msg2(struct libcfs_debug_msg_data * msgdata,
+ const char *fmt1, va_list args1,
+ const char *fmt2, va_list args2)
{
struct cfs_trace_cpu_data *tcd = NULL;
struct ptldebug_header header = {0};
- struct cfs_trace_page *tage;
+ struct cfs_trace_page *tage = NULL;
/* string_buf is used only if tcd != NULL, and is always set then */
char *string_buf = NULL;
char *debug_buf;
int known_size;
int needed = 85; /* average message length */
int max_nob;
- va_list ap;
int depth;
int i;
int remain;
- int mask = msgdata->msg_mask;
- char *file = (char *)msgdata->msg_file;
- cfs_debug_limit_state_t *cdls = msgdata->msg_cdls;
-
- if (strchr(file, '/'))
- file = strrchr(file, '/') + 1;
tcd = cfs_trace_get_tcd();
/* cfs_trace_get_tcd() grabs a lock, which disables preemption and
* pins us to a particular CPU. This avoids an smp_processor_id()
* warning on Linux when debugging is enabled. */
- cfs_set_ptldebug_header(&header, msgdata, CDEBUG_STACK());
-
- if (tcd == NULL) /* arch may not log in IRQ context */
- goto console;
- if (tcd->tcd_cur_pages == 0)
- header.ph_flags |= PH_FLAG_FIRST_RECORD;
+ cfs_set_ptldebug_header(&header, msgdata, 0);
- if (tcd->tcd_shutting_down) {
- cfs_trace_put_tcd(tcd);
- tcd = NULL;
- goto console;
- }
+ if (tcd == NULL) /* arch may not log in IRQ context */
+ return;
+ if (tcd->tcd_shutting_down)
+ goto out;
+
depth = __current_nesting_level();
- known_size = strlen(file) + 1 + depth;
+ known_size = strlen(msgdata->msg_file) + 1 + depth;
if (msgdata->msg_fn)
known_size += strlen(msgdata->msg_fn) + 1;
@@ -316,53 +290,45 @@
*/
for (i = 0; i < 2; i++) {
tage = cfs_trace_get_tage(tcd, needed + known_size + 1);
- if (tage == NULL) {
- if (needed + known_size > CFS_PAGE_SIZE)
- mask |= D_ERROR;
-
- cfs_trace_put_tcd(tcd);
- tcd = NULL;
- goto console;
- }
+ if (tage == NULL)
+ goto out;
- string_buf = (char *)cfs_page_address(tage->page) +
- tage->used + known_size;
+ string_buf = (char *)cfs_page_address(tage->page)+tage->used+known_size;
max_nob = CFS_PAGE_SIZE - tage->used - known_size;
if (max_nob <= 0) {
printk(CFS_KERN_EMERG "negative max_nob: %d\n",
max_nob);
- mask |= D_ERROR;
- cfs_trace_put_tcd(tcd);
- tcd = NULL;
- goto console;
+ goto out;
}
needed = 0;
- if (format1) {
- va_copy(ap, args);
- needed = vsnprintf(string_buf, max_nob, format1, ap);
- va_end(ap);
- }
-
- if (format2) {
- remain = max_nob - needed;
- if (remain < 0)
- remain = 0;
-
- va_start(ap, format2);
- needed += vsnprintf(string_buf + needed, remain,
- format2, ap);
- va_end(ap);
+ if (fmt1) {
+ va_list args;
+ va_copy(args, args1);
+ needed = vsnprintf(string_buf, max_nob, fmt1, args);
+ va_end(args);
+ }
+
+ if (fmt2) {
+ va_list args;
+ remain = max_nob - needed;
+ if (remain < 0)
+ remain = 0;
+
+ va_copy(args,args2);
+ needed += vsnprintf(string_buf + needed, remain,
+ fmt2, args);
+ va_end(args);
}
if (needed < max_nob) /* well. printing ok.. */
break;
- }
-
- if (*(string_buf+needed-1) != '\n')
+ }
+
+ if (*(string_buf + needed - 1) != '\n')
printk(CFS_KERN_INFO "format at %s:%d:%s doesn't end in "
- "newline\n", file, msgdata->msg_line, msgdata->msg_fn);
+ "newline\n", msgdata->msg_file, msgdata->msg_line, msgdata->msg_fn);
header.ph_len = known_size + needed;
debug_buf = (char *)cfs_page_address(tage->page) + tage->used;
@@ -376,109 +342,145 @@
/* indent message according to the nesting level */
while (depth-- > 0) {
*(debug_buf++) = '.';
- ++ tage->used;
+ ++tage->used;
}
- strcpy(debug_buf, file);
- tage->used += strlen(file) + 1;
- debug_buf += strlen(file) + 1;
+ strcpy(debug_buf, msgdata->msg_file);
+ tage->used += strlen(msgdata->msg_file) + 1;
+ debug_buf += strlen(msgdata->msg_file) + 1;
if (msgdata->msg_fn) {
strcpy(debug_buf, msgdata->msg_fn);
tage->used += strlen(msgdata->msg_fn) + 1;
debug_buf += strlen(msgdata->msg_fn) + 1;
}
-
+
__LASSERT(debug_buf == string_buf);
tage->used += needed;
__LASSERT (tage->used <= CFS_PAGE_SIZE);
+
+ out:
+ if (tcd != NULL)
+ cfs_trace_put_tcd(tcd);
+}
+
+static int cfs_debug_limit(cfs_debug_limit_state_t *cdls)
+{
+ int count;
+
+ if (cdls == NULL)
+ return 0;
+ if (libcfs_console_ratelimit &&
+ cdls->cdls_next != 0 && /* not first time ever */
+ !cfs_time_after(cfs_time_current(), cdls->cdls_next)) {
+ /* skipping a console message */
+ cdls->cdls_count++;
+ return -1;
+ }
+
+ if (cfs_time_after(cfs_time_current(),
+ cdls->cdls_next
+ + libcfs_console_max_delay
+ + cfs_time_seconds(10))) {
+ /* last timeout was a long time ago */
+ cdls->cdls_delay /= libcfs_console_backoff * 4;
+ } else {
+ cdls->cdls_delay *= libcfs_console_backoff;
+ if (cdls->cdls_delay < libcfs_console_min_delay)
+ cdls->cdls_delay = libcfs_console_min_delay;
+ else if (cdls->cdls_delay > libcfs_console_max_delay)
+ cdls->cdls_delay = libcfs_console_max_delay;
+ }
+ /* ensure cdls_next is never zero after it's been seen */
+ cdls->cdls_next = (cfs_time_current() + cdls->cdls_delay) | 1;
+ count = cdls->cdls_count;
+ cdls->cdls_count = 0;
+ return count;
+}
-console:
- if ((mask & libcfs_printk) == 0) {
- /* no console output requested */
- if (tcd != NULL)
- cfs_trace_put_tcd(tcd);
- return 1;
- }
-
- if (cdls != NULL) {
- if (libcfs_console_ratelimit &&
- cdls->cdls_next != 0 && /* not first time ever */
- !cfs_time_after(cfs_time_current(), cdls->cdls_next)) {
- /* skipping a console message */
- cdls->cdls_count++;
- if (tcd != NULL)
- cfs_trace_put_tcd(tcd);
- return 1;
- }
-
- if (cfs_time_after(cfs_time_current(), cdls->cdls_next +
- libcfs_console_max_delay
- + cfs_time_seconds(10))) {
- /* last timeout was a long time ago */
- cdls->cdls_delay /= libcfs_console_backoff * 4;
- } else {
- cdls->cdls_delay *= libcfs_console_backoff;
-
- if (cdls->cdls_delay < libcfs_console_min_delay)
- cdls->cdls_delay = libcfs_console_min_delay;
- else if (cdls->cdls_delay > libcfs_console_max_delay)
- cdls->cdls_delay = libcfs_console_max_delay;
- }
-
- /* ensure cdls_next is never zero after it's been seen */
- cdls->cdls_next = (cfs_time_current() + cdls->cdls_delay) | 1;
- }
-
- if (tcd != NULL) {
- cfs_print_to_console(&header, mask, string_buf, needed, file,
- msgdata->msg_fn);
- cfs_trace_put_tcd(tcd);
- } else {
- string_buf = cfs_trace_get_console_buffer();
-
- needed = 0;
- if (format1 != NULL) {
- va_copy(ap, args);
- needed = vsnprintf(string_buf,
- CFS_TRACE_CONSOLE_BUFFER_SIZE,
- format1, ap);
- va_end(ap);
- }
- if (format2 != NULL) {
- remain = CFS_TRACE_CONSOLE_BUFFER_SIZE - needed;
- if (remain > 0) {
- va_start(ap, format2);
- needed += vsnprintf(string_buf+needed, remain,
- format2, ap);
- va_end(ap);
- }
- }
- cfs_print_to_console(&header, mask,
- string_buf, needed, file, msgdata->msg_fn);
-
- cfs_trace_put_console_buffer(string_buf);
- }
-
- if (cdls != NULL && cdls->cdls_count != 0) {
- string_buf = cfs_trace_get_console_buffer();
+int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
+ const char *fmt, ...)
+{
+ va_list args;
- needed = snprintf(string_buf, CFS_TRACE_CONSOLE_BUFFER_SIZE,
- "Skipped %d previous similar message%s\n",
- cdls->cdls_count,
- (cdls->cdls_count > 1) ? "s" : "");
+ va_start(args, fmt);
+ libcfs_debug_msg2(msgdata, fmt, args, NULL);
+ va_end(args);
- cfs_print_to_console(&header, mask,
- string_buf, needed, file, msgdata->msg_fn);
+ return 0;
+}
+EXPORT_SYMBOL(libcfs_debug_msg);
- cfs_trace_put_console_buffer(string_buf);
- cdls->cdls_count = 0;
- }
+/* MOVEME */
+#define CONFIG_VPRINTK2
+/* MOVEME */
+static inline void cfs_vprintk2(const char *fmt1, va_list args1, const char *fmt2, va_list args2)
+{
+#if defined(CONFIG_VPRINTK2)
+
+ int vprintk2(const char *fmt1, va_list args1, const char *fmt2, va_list args2);
+ vprintk2(fmt1, args1, fmt2, args2);
+
+#elif defined(CONFIG_VPRINTK2_MAYBE)
+
+ int vprintk2(const char *fmt1, va_list args1, const char *fmt2, va_list args2)
+ __attribute__((weak));
+
+ if (vprintk2 == NULL) {
+ vprintk(fmt1, args1);
+ vprintk(fmt2, args2);
+ } else {
+ vprintk2(fmt1, args1, fmt2, args2);
+ }
+#else
+ vprintk(fmt1, args1);
+ vprintk(fmt2, args2);
+#endif
+}
- return 0;
+int libcfs_debug_msg2(struct libcfs_debug_msg_data *msgdata,
+ const char *fmt1, va_list args1, const char *fmt2, ...)
+{
+ va_list trace_args1, args2;
+ const char *trace_fmt1, *prio, *file, *func;
+ int pid, line, count;
+
+ trace_fmt1 = fmt1 + strlen(CFS_DEBUG_HDR_FMT);
+
+ va_copy(trace_args1, args1);
+ va_start(args2, fmt2);
+
+ prio = va_arg(trace_args1, char *);
+ pid = va_arg(trace_args1, int);
+ file = va_arg(trace_args1, char *);
+ line = va_arg(trace_args1, int);
+ func = va_arg(trace_args1, char *);
+
+ trace_msg2(msgdata, trace_fmt1, trace_args1, fmt2, args2);
+ va_end(args2);
+ va_end(trace_args1);
+
+ if ((msgdata->msg_mask & libcfs_printk) == 0)
+ return 0;
+
+ if ((count = cfs_debug_limit(msgdata->msg_cdls)) < 0)
+ return 0;
+
+ if (fmt2 == NULL) {
+ vprintk(fmt1, args1);
+ } else {
+ va_start(args2, fmt2);
+ cfs_vprintk2(fmt1, args1, fmt2, args2);
+ va_end(args2);
+ }
+
+ if (count > 0)
+ printk("%sLustre: %d:(%s:%d:%s()) Skipped %d previous similar message%s\n",
+ prio, pid, file, line, func, count, count > 1 ? "s" : "");
+ return 0;
}
-EXPORT_SYMBOL(libcfs_debug_vmsg2);
+EXPORT_SYMBOL(libcfs_debug_msg2);
void
cfs_trace_assertion_failed(const char *str,
@@ -490,7 +492,7 @@
libcfs_catastrophe = 1;
cfs_mb();
- cfs_set_ptldebug_header(&hdr, msgdata, CDEBUG_STACK());
+ cfs_set_ptldebug_header(&hdr,msgdata,0);
cfs_print_to_console(&hdr, D_EMERG, str, strlen(str),
msgdata->msg_file, msgdata->msg_fn);
diff -urN lustre_backup/libcfs/libcfs/tracefile.h lustre-release/libcfs/libcfs/tracefile.h
--- lustre_backup/libcfs/libcfs/tracefile.h 2013-12-17 13:20:46.173198204 -0600
+++ lustre-release/libcfs/libcfs/tracefile.h 2013-12-18 15:36:40.896304940 -0600
@@ -70,9 +70,6 @@
void cfs_trace_stop_thread(void);
int cfs_tracefile_init(int max_pages);
void cfs_tracefile_exit(void);
-
-
-
int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob,
const char *usr_buffer, int usr_buffer_nob);
int cfs_trace_copyout_string(char *usr_buffer, int usr_buffer_nob,
@@ -262,6 +259,7 @@
extern void cfs_set_ptldebug_header(struct ptldebug_header *header,
struct libcfs_debug_msg_data *m,
unsigned long stack);
+
extern void cfs_print_to_console(struct ptldebug_header *hdr, int mask,
const char *buf, int len, const char *file,
const char *fn);
@@ -327,7 +325,7 @@
#define __LASSERT(cond) \
do { \
if (unlikely(!(cond))) { \
- LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_EMERG, NULL); \
+ LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_EMERG, NULL); \
cfs_trace_assertion_failed("ASSERTION("#cond") failed", \
&msgdata); \
} \
diff -urN lustre_backup/libcfs/libcfs/workitem.c lustre-release/libcfs/libcfs/workitem.c
--- lustre_backup/libcfs/libcfs/workitem.c 2013-12-17 13:20:46.177200203 -0600
+++ lustre-release/libcfs/libcfs/workitem.c 2013-12-19 11:23:02.131634078 -0600
@@ -389,8 +389,9 @@
void
cfs_wi_sched_destroy(struct cfs_wi_sched *sched)
{
- int i;
-
+ int i;
+ int mask;
+ mask = 0;
LASSERT(cfs_wi_data.wi_init);
LASSERT(!cfs_wi_data.wi_stopping);
@@ -409,11 +410,13 @@
i = 2;
#ifdef __KERNEL__
+
cfs_waitq_broadcast(&sched->ws_waitq);
spin_lock(&cfs_wi_data.wi_glock);
while (sched->ws_nthreads > 0) {
- CDEBUG(IS_PO2(++i) ? D_WARNING : D_NET,
+ mask = IS_PO2(++i) ? D_WARNING : D_NET;
+ CDEBUG(mask,
"waiting for %d threads of WI sched[%s] to terminate\n",
sched->ws_nthreads, sched->ws_name);
diff -urN lustre_backup/libsysio/tests/Makefile lustre-release/libsysio/tests/Makefile
--- lustre_backup/libsysio/tests/Makefile 2014-02-20 10:51:39.656578417 -0600
+++ lustre-release/libsysio/tests/Makefile 2014-02-20 10:58:07.648477206 -0600
@@ -236,12 +236,12 @@
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = ${SHELL} /home/rtevans/build/lustre_backup/libsysio/missing --run aclocal-1.11
-AMTAR = ${SHELL} /home/rtevans/build/lustre_backup/libsysio/missing --run tar
+ACLOCAL = ${SHELL} /home/rtevans/build/lustre-release/libsysio/missing --run aclocal-1.11
+AMTAR = ${SHELL} /home/rtevans/build/lustre-release/libsysio/missing --run tar
AR = ar
-AUTOCONF = ${SHELL} /home/rtevans/build/lustre_backup/libsysio/missing --run autoconf
-AUTOHEADER = ${SHELL} /home/rtevans/build/lustre_backup/libsysio/missing --run autoheader
-AUTOMAKE = ${SHELL} /home/rtevans/build/lustre_backup/libsysio/missing --run automake-1.11
+AUTOCONF = ${SHELL} /home/rtevans/build/lustre-release/libsysio/missing --run autoconf
+AUTOHEADER = ${SHELL} /home/rtevans/build/lustre-release/libsysio/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/rtevans/build/lustre-release/libsysio/missing --run automake-1.11
AUTOMOUNT =
AWK = gawk
CC = gcc
@@ -266,12 +266,12 @@
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LD = ld
LDFLAGS =
-LIBBUILD_DIR = /home/rtevans/build/lustre_backup/libsysio/lib
+LIBBUILD_DIR = /home/rtevans/build/lustre-release/libsysio/lib
LIBOBJS =
LIBS = $(LIBBUILD_DIR)/libsysio.a
LTLIBOBJS =
MAINT =
-MAKEINFO = ${SHELL} /home/rtevans/build/lustre_backup/libsysio/missing --run makeinfo
+MAKEINFO = ${SHELL} /home/rtevans/build/lustre-release/libsysio/missing --run makeinfo
MKDIR_P = /bin/mkdir -p
OBJDUMP = objdump
OBJEXT = o
@@ -290,10 +290,10 @@
TRACING = -DSYSIO_TRACING=1
VERSION = 1.2
ZERO_SUM_MEMORY =
-abs_builddir = /home/rtevans/build/lustre_backup/libsysio/tests
-abs_srcdir = /home/rtevans/build/lustre_backup/libsysio/tests
-abs_top_builddir = /home/rtevans/build/lustre_backup/libsysio
-abs_top_srcdir = /home/rtevans/build/lustre_backup/libsysio
+abs_builddir = /home/rtevans/build/lustre-release/libsysio/tests
+abs_srcdir = /home/rtevans/build/lustre-release/libsysio/tests
+abs_top_builddir = /home/rtevans/build/lustre-release/libsysio
+abs_top_srcdir = /home/rtevans/build/lustre-release/libsysio
ac_ct_CC = gcc
am__include = include
am__leading_dot = .
@@ -320,7 +320,7 @@
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
-install_sh = ${SHELL} /home/rtevans/build/lustre_backup/libsysio/install-sh
+install_sh = ${SHELL} /home/rtevans/build/lustre-release/libsysio/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
Binary files lustre_backup/lnet/klnds/o2iblnd/ko2iblnd.ko.unsigned and lustre-release/lnet/klnds/o2iblnd/ko2iblnd.ko.unsigned differ
diff -urN lustre_backup/lnet/klnds/o2iblnd/modules.order lustre-release/lnet/klnds/o2iblnd/modules.order
--- lustre_backup/lnet/klnds/o2iblnd/modules.order 1969-12-31 18:00:00.000000000 -0600
+++ lustre-release/lnet/klnds/o2iblnd/modules.order 2014-01-06 14:08:00.945761998 -0600
@@ -0,0 +1 @@
+kernel//home/rtevans/build/lustre-release/lnet/klnds/o2iblnd/ko2iblnd.ko
Binary files lustre_backup/lnet/klnds/socklnd/ksocklnd.ko.unsigned and lustre-release/lnet/klnds/socklnd/ksocklnd.ko.unsigned differ
diff -urN lustre_backup/lnet/klnds/socklnd/modules.order lustre-release/lnet/klnds/socklnd/modules.order
--- lustre_backup/lnet/klnds/socklnd/modules.order 1969-12-31 18:00:00.000000000 -0600
+++ lustre-release/lnet/klnds/socklnd/modules.order 2014-01-06 14:08:01.072825498 -0600
@@ -0,0 +1 @@
+kernel//home/rtevans/build/lustre-release/lnet/klnds/socklnd/ksocklnd.ko
Binary files lustre_backup/lnet/lnet/lnet.ko.unsigned and lustre-release/lnet/lnet/lnet.ko.unsigned differ
diff -urN lustre_backup/lnet/lnet/modules.order lustre-release/lnet/lnet/modules.order
--- lustre_backup/lnet/lnet/modules.order 1969-12-31 18:00:00.000000000 -0600
+++ lustre-release/lnet/lnet/modules.order 2014-01-06 14:08:01.259918998 -0600
@@ -0,0 +1 @@
+kernel//home/rtevans/build/lustre-release/lnet/lnet/lnet.ko
Binary files lustre_backup/lnet/selftest/lnet_selftest.ko.unsigned and lustre-release/lnet/selftest/lnet_selftest.ko.unsigned differ
diff -urN lustre_backup/lnet/selftest/modules.order lustre-release/lnet/selftest/modules.order
--- lustre_backup/lnet/selftest/modules.order 1969-12-31 18:00:00.000000000 -0600
+++ lustre-release/lnet/selftest/modules.order 2014-01-06 14:08:01.409993997 -0600
@@ -0,0 +1 @@
+kernel//home/rtevans/build/lustre-release/lnet/selftest/lnet_selftest.ko
diff -urN lustre_backup/lnet/selftest/selftest.h lustre-release/lnet/selftest/selftest.h
--- lustre_backup/lnet/selftest/selftest.h 2013-12-17 13:20:46.222222703 -0600
+++ lustre-release/lnet/selftest/selftest.h 2013-12-18 14:50:19.734418946 -0600
@@ -617,9 +617,10 @@
#define lst_wait_until(cond, lock, fmt, ...) \
do { \
- int __I = 2; \
+ int __I = 2; \
+ int mask = IS_PO2(++__I) ? D_WARNING : D_NET; \
while (!(cond)) { \
- CDEBUG(IS_PO2(++__I) ? D_WARNING : D_NET, \
+ CDEBUG(mask, \
fmt, ## __VA_ARGS__); \
spin_unlock(&(lock)); \
\
Binary files lustre_backup/lustre/fid/fid.ko.unsigned and lustre-release/lustre/fid/fid.ko.unsigned differ