[16] | 1 | #! /bin/awk -f |
---|
| 2 | # fsstructlx.awk will decode Linux error messages in /var/log/messages to be more readable. |
---|
| 3 | # setting all=1 will print out all error entries, all=0 will just print out |
---|
| 4 | # GPFS related error entries. |
---|
| 5 | ############################################################################# |
---|
| 6 | # |
---|
| 7 | # Usage: fsstructlx.awk [<all=1>] <filename> |
---|
| 8 | # |
---|
| 9 | ############################################################################# |
---|
| 10 | |
---|
| 11 | |
---|
| 12 | BEGIN { |
---|
| 13 | if (ARGC<2) |
---|
| 14 | { |
---|
| 15 | print "Usage: fsstructlx.awk [<all=1>] <filename>" |
---|
| 16 | terminate=1 |
---|
| 17 | exit 1 |
---|
| 18 | } |
---|
| 19 | |
---|
| 20 | wide=1 #set to 0 for pre-gpfs2.3 versions that do not use wide disk addresses |
---|
| 21 | all=0 |
---|
| 22 | decode=1 |
---|
| 23 | CONVFMT="%.12g" |
---|
| 24 | OFMT="%.12g" |
---|
| 25 | name[101]="FSErrInconsistentInode "; sens[101]=5; fmt[101]="4 8 8 2 v" |
---|
| 26 | name[102]="FSErrIndirectBlock "; sens[102]=5; fmt[102]="f 4 4 4 v" |
---|
| 27 | name[104]="FSErrBadReplicationCounts"; sens[104]=5; fmt[104]="4 v" |
---|
| 28 | name[105]="FSErrBadPtrReplications "; sens[105]=5; fmt[105]="4 2 2 2 v" |
---|
| 29 | name[106]="FSErrIndirectionLevel "; sens[106]=5; fmt[106]="4 2 v" |
---|
| 30 | name[107]="FSErrDeallocBlock "; sens[107]=1; fmt[107]="4 4 4 4 4 4 4 4" |
---|
| 31 | #wide alt#name[107]="FSErrDeallocBlock "; sens[107]=1; fmt[107]="4 4 8 4 4 4 4" |
---|
| 32 | name[108]="FSErrValidate "; sens[108]=5; fmt[108]="2 d 2 r v" |
---|
| 33 | name[109]="FSErrBadDiskAddrIndex "; sens[109]=1; fmt[109]="d 2" |
---|
| 34 | name[110]="FSErrBadDiskAddrSector "; sens[110]=1; fmt[110]="d 2 2" |
---|
| 35 | name[111]="FSErrBadDirBlock "; sens[111]=2; fmt[111]="4 4 4 4 4 4 4 4 4 4" |
---|
| 36 | name[112]="FSErrBadInodeStatus "; sens[112]=5; fmt[112]="4 v" |
---|
| 37 | name[113]="FSErrBadInodeOrGen "; sens[113]=5; fmt[113]="4 4 4 v" |
---|
| 38 | name[114]="FSErrAllocBlock "; sens[114]=1; fmt[114]="4 4 4 4" |
---|
| 39 | name[115]="FSErrBadDittoAddr "; sens[115]=2; fmt[115]="4 4 4 4 4 4 4 4 8" |
---|
| 40 | name[116]="FSErrSnapInodeModified "; sens[116]=5; fmt[116]="4 4 4 4 v" |
---|
| 41 | |
---|
| 42 | # subcode of 111 FSErrBadDirBlock |
---|
| 43 | name[201]="DirErrCheckHeaderFailed "; sens[201]=2; fmt[201]="4 4 4 4 4 4 4 4 4 4" |
---|
| 44 | name[202]="DirErrDotDotNotFound "; sens[202]=2; fmt[202]="4 4 4 4 4 4" |
---|
| 45 | name[203]="DirErrGenNumMismatch "; sens[203]=2; fmt[203]="4 4 4 4 4 4" |
---|
| 46 | name[204]="DirErrInodeNumMismatch "; sens[204]=2; fmt[204]="4 4 4 4 4 4" |
---|
| 47 | name[205]="DirErrInodeCorrupted "; sens[205]=2; fmt[205]="4 4 4 4 4 4" |
---|
| 48 | name[206]="DirErrDirectCorrupted "; sens[206]=2; fmt[206]="4 4 4 4 4 4" |
---|
| 49 | |
---|
| 50 | valtype[1]="inode" |
---|
| 51 | valtype[2]="indBlock" |
---|
| 52 | valtype[3]="dataAllocmap" |
---|
| 53 | valtype[4]="inodeAllocmap" |
---|
| 54 | valtype[5]="dirBlock" |
---|
| 55 | valtype[6]="bufDataAllocMap" |
---|
| 56 | |
---|
| 57 | buftype[0]="PBT_UNKNOWN" |
---|
| 58 | buftype[1]="PBT_FREE" |
---|
| 59 | buftype[2]="PBT_METADATA" |
---|
| 60 | buftype[3]="PBT_TEMP" |
---|
| 61 | buftype[4]="PBT_DISKDESC" |
---|
| 62 | buftype[5]="PBT_SGDESC" |
---|
| 63 | buftype[6]="PBT_DATA" |
---|
| 64 | buftype[7]="PBT_IND" |
---|
| 65 | buftype[8]="PBT_INODE" |
---|
| 66 | buftype[9]="PBT_LLDATA" |
---|
| 67 | buftype[10]="PBT_LLINDIRECT" |
---|
| 68 | buftype[11]="PBT_LLINODE" |
---|
| 69 | buftype[12]="PBT_ALLOC" |
---|
| 70 | buftype[13]="PBT_IALLOC" |
---|
| 71 | buftype[14]="PBT_LOG" |
---|
| 72 | buftype[15]="PBT_LOGDESC" |
---|
| 73 | buftype[16]="PBT_RECOV" |
---|
| 74 | buftype[17]="PBT_LOG_WRAP" |
---|
| 75 | buftype[18]="PBT_ISCAN" |
---|
| 76 | |
---|
| 77 | allerrtype["FFFF"]="NoBlock" |
---|
| 78 | allerrtype["FFFE"]="LinkListFirst" |
---|
| 79 | allerrtype["FFFD"]="NoConsecutive" |
---|
| 80 | allerrtype["FFFC"]="LinkListNth" |
---|
| 81 | allerrtype["FFFB"]="LinkListNew" |
---|
| 82 | |
---|
| 83 | monthof["Jan"]="01" |
---|
| 84 | monthof["Feb"]="02" |
---|
| 85 | monthof["Mar"]="03" |
---|
| 86 | monthof["Apr"]="04" |
---|
| 87 | monthof["May"]="05" |
---|
| 88 | monthof["Jun"]="06" |
---|
| 89 | monthof["Jul"]="07" |
---|
| 90 | monthof["Aug"]="08" |
---|
| 91 | monthof["Sep"]="09" |
---|
| 92 | monthof["Oct"]="10" |
---|
| 93 | monthof["Nov"]="11" |
---|
| 94 | monthof["Dec"]="12" |
---|
| 95 | |
---|
| 96 | } |
---|
| 97 | function hexToDecimal(hex, d, ch, i, val) |
---|
| 98 | { |
---|
| 99 | d = 0 |
---|
| 100 | for (i=1 ; i<=length(hex) ; i++) |
---|
| 101 | { |
---|
| 102 | ch = substr(hex,i,1) |
---|
| 103 | val = index("0123456789ABCDEF", ch) |
---|
| 104 | if (val == 0) |
---|
| 105 | val = index("0123456789abcdef", ch) |
---|
| 106 | d = d*16 + val - 1 |
---|
| 107 | } |
---|
| 108 | return d |
---|
| 109 | } |
---|
| 110 | |
---|
| 111 | function handle_mmfs_line(ln) |
---|
| 112 | { |
---|
| 113 | $0=ln |
---|
| 114 | mon=monthof[$1]; if (mon == "") mon=$1 |
---|
| 115 | day=$2; if (day < 10) day="0"day |
---|
| 116 | date=mon"/"day"@"$3 |
---|
| 117 | node=$4 |
---|
| 118 | printed=0 |
---|
| 119 | if (index($0, "mmfs: Generic error") > 0) |
---|
| 120 | { |
---|
| 121 | module=$9 |
---|
| 122 | pos=index(module,"/") |
---|
| 123 | while (pos > 0) |
---|
| 124 | { |
---|
| 125 | module=substr(module,pos+1) |
---|
| 126 | pos=index(module,"/") |
---|
| 127 | } |
---|
| 128 | lineno=$11 |
---|
| 129 | rcode=substr($13,1,length($13)-1) |
---|
| 130 | rscode=$15 |
---|
| 131 | # assume it belongs to last tag seen |
---|
| 132 | sense[subscr] = sense[subscr] " rc="rcode" reason="rscode" line "lineno" "module |
---|
| 133 | printed=1 |
---|
| 134 | } |
---|
| 135 | else if (index($0, "mmfs: Tag=") > 0) |
---|
| 136 | { |
---|
| 137 | pos=index($0,"Tag=") |
---|
| 138 | tag=substr($6,5) |
---|
| 139 | subscr=FILENAME SUBSEP tag |
---|
| 140 | rest=substr($0,pos+length($6)+1) |
---|
| 141 | sense[subscr] = sense[subscr] " failedassert=" rest |
---|
| 142 | printed=1 |
---|
| 143 | } |
---|
| 144 | else if (substr($6,1,6) == "Error=" || substr($7,1,6) == "Error=" ) |
---|
| 145 | { |
---|
| 146 | if ($6 == "mmfsd:") |
---|
| 147 | { |
---|
| 148 | label=substr($7,7) |
---|
| 149 | id=substr($8,6) |
---|
| 150 | tag=substr($9,5) |
---|
| 151 | } |
---|
| 152 | else |
---|
| 153 | { |
---|
| 154 | label=substr($6,7) |
---|
| 155 | id=substr($7,6) |
---|
| 156 | tag=substr($8,5) |
---|
| 157 | } |
---|
| 158 | label=substr(label,1,length(label)-1) |
---|
| 159 | id=substr(id,1,length(id)-1) |
---|
| 160 | if (substr(tag,length(tag)) == ":") tag=substr(tag,1,length(tag)-1) |
---|
| 161 | subscr=FILENAME SUBSEP tag |
---|
| 162 | if (seentag[subscr] == "") |
---|
| 163 | { |
---|
| 164 | tags++ |
---|
| 165 | taglist[tags]=subscr |
---|
| 166 | seentag[subscr]=sprintf("%s %s %s %s", date, node, label, id) |
---|
| 167 | } |
---|
| 168 | pos=index($0,"Tag=") |
---|
| 169 | if (pos > 0) |
---|
| 170 | { |
---|
| 171 | rest=substr($0,pos) |
---|
| 172 | pos=index(rest,":") |
---|
| 173 | if (pos > 0) |
---|
| 174 | rest=substr(rest,pos+1) |
---|
| 175 | sense[subscr] = sense[subscr] " " rest |
---|
| 176 | } |
---|
| 177 | if (label == "MMFS_FSSTRUCT") |
---|
| 178 | { |
---|
| 179 | pos=index($0,"Error code") |
---|
| 180 | if (pos > 0) |
---|
| 181 | { |
---|
| 182 | ingpfs=1; infsstruct=1 |
---|
| 183 | $0=substr($0,pos) |
---|
| 184 | code=substr($3,1,length($3)-1) |
---|
| 185 | count[code]++ |
---|
| 186 | vol=$5 |
---|
| 187 | seentag[subscr] = seentag[subscr] " " code " " vol |
---|
| 188 | sense[subscr] = "" |
---|
| 189 | } |
---|
| 190 | printed=1 |
---|
| 191 | } |
---|
| 192 | else if (label == "MMFS_PHOENIX") {printed=1; ingpfs=1; inphoenix=1} |
---|
| 193 | else if (label == "MMFS_GENERIC") {printed=1; ingpfs=1; ingeneric=1} |
---|
| 194 | else if (label == "MMFS_ABNORMAL_SHUTDOWN") {printed=1; ingpfs=1; inshutdown=1} |
---|
| 195 | else if (label == "MMFS_LONGDISKIO") {printed=1; ingpfs=1; inlongdiskio=1} |
---|
| 196 | else if (label == "MMFS_SYSTEM_UNMOUNT") {printed=1; ingpfs=1; inunmount=1} |
---|
| 197 | else if (label == "MMFS_DISKFAIL") {printed=1; ingpfs=1; indiskfail=1} |
---|
| 198 | else if (label == "MMFS_TRACEBACK") {printed=1; ingpfs=1; intraceback=1} |
---|
| 199 | else if (label == "MMFS_MOREINFO") {printed=1; ingpfs=1; inmoreinfo=1} |
---|
| 200 | else if (label == "MMFS_QUOTA") {printed=1; ingpfs=1; inquota=1} |
---|
| 201 | else if (label == "MMFS_ENVIRON") {printed=1; ingpfs=1; inenviron=1} |
---|
| 202 | else if (label == "MMFS_RECOVERY") {printed=1; ingpfs=1; inrecovery=1} |
---|
| 203 | else if (label == "MMFS_SYSTEM_WARNING") {printed=1; ingpfs=1; inwarning=1} |
---|
| 204 | else |
---|
| 205 | { |
---|
| 206 | rest="" |
---|
| 207 | pos=index($0,"Tag=") |
---|
| 208 | if (pos > 0) |
---|
| 209 | { |
---|
| 210 | $0=substr($0,pos) |
---|
| 211 | cpos=index($0,":") |
---|
| 212 | if (cpos > 0) rest=substr($0,cpos+2) |
---|
| 213 | else {$1=""; rest=$0} |
---|
| 214 | sense[subscr] = sense[subscr] " " rest |
---|
| 215 | printed=1 |
---|
| 216 | } |
---|
| 217 | } |
---|
| 218 | } |
---|
| 219 | else |
---|
| 220 | { |
---|
| 221 | if (all) |
---|
| 222 | { |
---|
| 223 | mon=monthof[$1]; if (mon == "") mon=$1 |
---|
| 224 | day=$2; if (day < 10) day="0"day |
---|
| 225 | date=mon"/"day"@"$3 |
---|
| 226 | node=$4 |
---|
| 227 | $1=date; $2=node; $3=""; $4="" |
---|
| 228 | print $0 |
---|
| 229 | } |
---|
| 230 | printed=1 |
---|
| 231 | } |
---|
| 232 | if (!printed) print $0 |
---|
| 233 | } |
---|
| 234 | |
---|
| 235 | |
---|
| 236 | # Main loop per record |
---|
| 237 | { |
---|
| 238 | if (substr($1,length($1)) == ":") |
---|
| 239 | { |
---|
| 240 | prenode=$1 |
---|
| 241 | pos=index($0,":") |
---|
| 242 | $0=substr($0,pos+2) |
---|
| 243 | } |
---|
| 244 | origln=$0 |
---|
| 245 | if (index(origln,"mmfs:") > 0) |
---|
| 246 | { |
---|
| 247 | if (index(origln,"unsupported module") == 0 && |
---|
| 248 | index(origln,"module license") == 0) |
---|
| 249 | { |
---|
| 250 | handle_mmfs_line(origln) |
---|
| 251 | lastline=origln |
---|
| 252 | } |
---|
| 253 | } |
---|
| 254 | else |
---|
| 255 | { |
---|
| 256 | pos=index(origln,"last message repeated") |
---|
| 257 | if (pos > 0 && index(lastline,"mmfs:") > 0) |
---|
| 258 | { |
---|
| 259 | $0=substr(origln,pos+21) |
---|
| 260 | for (cnt=$1; cnt > 0; cnt--) |
---|
| 261 | handle_mmfs_line(lastline) |
---|
| 262 | } |
---|
| 263 | else |
---|
| 264 | { |
---|
| 265 | lastline=origln |
---|
| 266 | if (all) |
---|
| 267 | { |
---|
| 268 | $0 = origln |
---|
| 269 | mon=monthof[$1]; if (mon == "") mon=$1 |
---|
| 270 | day=$2; if (day < 10) day="0"day |
---|
| 271 | date=mon"/"day"@"$3 |
---|
| 272 | node=$4 |
---|
| 273 | $1=date; $2=node; $3=""; $4="" |
---|
| 274 | print $0 |
---|
| 275 | } |
---|
| 276 | } |
---|
| 277 | } |
---|
| 278 | } |
---|
| 279 | function print_gpfstag(tag) |
---|
| 280 | { |
---|
| 281 | $0=seentag[tag] |
---|
| 282 | date=$1; node=$2; label=$3; id=$4; code=$5; vol=$6 |
---|
| 283 | if (label != "MMFS_FSSTRUCT") |
---|
| 284 | { |
---|
| 285 | print seentag[tag] sense[tag] |
---|
| 286 | } |
---|
| 287 | if (label == "MMFS_FSSTRUCT") |
---|
| 288 | { |
---|
| 289 | $0=sense[tag] |
---|
| 290 | NF = split($0, wds) |
---|
| 291 | wd=3 |
---|
| 292 | if (code == 111) # FSErrBadDirBlock |
---|
| 293 | { |
---|
| 294 | code=hexToDecimal($(wd)); |
---|
| 295 | if (code >= 201 && code <= 206) |
---|
| 296 | wd+=4 |
---|
| 297 | else code=111 |
---|
| 298 | } |
---|
| 299 | formt=fmt[code] |
---|
| 300 | if (!decode || formt == "") |
---|
| 301 | printf("%s %s %s %s %s %s %s\n", |
---|
| 302 | date, node, "FSSTRUCTX", vol, code, name[code], sense[tag]) |
---|
| 303 | else |
---|
| 304 | { |
---|
| 305 | tokens=0 |
---|
| 306 | for (f=1; f <= length(formt); f++) |
---|
| 307 | { |
---|
| 308 | ch = substr(formt,f,1) |
---|
| 309 | if (ch != " ") |
---|
| 310 | { |
---|
| 311 | tokens++ |
---|
| 312 | if (ch == "4") |
---|
| 313 | { |
---|
| 314 | tok[tokens] = $(wd+3) $(wd+2) $(wd+1) $wd ; wd+=4 |
---|
| 315 | } |
---|
| 316 | else if (ch == "2") |
---|
| 317 | { |
---|
| 318 | tok[tokens] = $(wd+1) $wd; wd+=2 |
---|
| 319 | } |
---|
| 320 | else if (ch == "8") |
---|
| 321 | { |
---|
| 322 | tok[tokens] = $(wd+7) $(wd+6) $(wd+5) $(wd+4) $(wd+3) $(wd+2) $(wd+1) $wd; wd+=8 |
---|
| 323 | } |
---|
| 324 | else if (ch == "d") |
---|
| 325 | { |
---|
| 326 | if (wide) |
---|
| 327 | { |
---|
| 328 | tok[tokens] = $wd $(wd+1) $(wd+2) $(wd+3)":"$(wd+4) $(wd+5) $(wd+6) $(wd+7) $(wd+8) $(wd+9) $(wd+10) $(wd+11)"("hexToDecimal($wd $(wd+1) $(wd+2) $(wd+3))":"hexToDecimal($(wd+4) $(wd+5) $(wd+6) $(wd+7) $(wd+8) $(wd+9) $(wd+10) $(wd+11))")"; wd+=12 |
---|
| 329 | } |
---|
| 330 | else |
---|
| 331 | { |
---|
| 332 | tok[tokens] = $wd $(wd+1)":"$(wd+2) $(wd+3) $(wd+4) $(wd+5)"("hexToDecimal($wd $(wd+1))":"hexToDecimal($(wd+2) $(wd+3) $(wd+4) $(wd+5))")"; wd+=6 |
---|
| 333 | } |
---|
| 334 | } |
---|
| 335 | else if (ch == "r") |
---|
| 336 | { |
---|
| 337 | nval=$(wd+1) $wd; wd+=2 |
---|
| 338 | if (nval == "FFFF") |
---|
| 339 | tok[tokens]="[broken]" |
---|
| 340 | else |
---|
| 341 | { |
---|
| 342 | nval+=0 |
---|
| 343 | tok[tokens] = "[nVal="nval |
---|
| 344 | while (nval > 0) |
---|
| 345 | { |
---|
| 346 | if (wide) |
---|
| 347 | { |
---|
| 348 | tok[tokens] = tok[tokens]" "$wd $(wd+1) $(wd+2) $(wd+3)":"$(wd+4) $(wd+5) $(wd+6) $(wd+7) $(wd+8) $(wd+9) $(wd+10) $(wd+11)"("hexToDecimal($wd $(wd+1) $(wd+2) $(wd+3))":"hexToDecimal($(wd+4) $(wd+5) $(wd+6) $(wd+7) $(wd+8) $(wd+9) $(wd+10) $(wd+11))")"; wd+=12 |
---|
| 349 | } |
---|
| 350 | else |
---|
| 351 | { |
---|
| 352 | tok[tokens] = tok[tokens]" "$wd $(wd+1)":"$(wd+2) $(wd+3) $(wd+4) $(wd+5)"("hexToDecimal($wd $(wd+1))":"hexToDecimal($(wd+2) $(wd+3) $(wd+4) $(wd+5))")"; wd+=6 |
---|
| 353 | } |
---|
| 354 | nval-- |
---|
| 355 | } |
---|
| 356 | tok[tokens] = tok[tokens]"]" |
---|
| 357 | } |
---|
| 358 | } |
---|
| 359 | else if (ch == "f") |
---|
| 360 | { |
---|
| 361 | nval=$(wd+1) $wd; wd+=2 |
---|
| 362 | if (nval == "FFFF") |
---|
| 363 | tok[tokens]="[broken" |
---|
| 364 | else |
---|
| 365 | { |
---|
| 366 | nval+=0 |
---|
| 367 | tok[tokens] = "[nVal="nval |
---|
| 368 | while (nval > 0) |
---|
| 369 | { |
---|
| 370 | if (wide) |
---|
| 371 | { |
---|
| 372 | tok[tokens] = tok[tokens]" "$wd $(wd+1) $(wd+2) $(wd+3)":"$(wd+4) $(wd+5) $(wd+6) $(wd+7) $(wd+8) $(wd+9) $(wd+10) $(wd+11)"("hexToDecimal($wd $(wd+1) $(wd+2) $(wd+3))":"hexToDecimal($(wd+4) $(wd+5) $(wd+6) $(wd+7) $(wd+8) $(wd+9) $(wd+10) $(wd+11))")"; wd+=12 |
---|
| 373 | } |
---|
| 374 | else |
---|
| 375 | { |
---|
| 376 | tok[tokens] = tok[tokens]" "$wd $(wd+1)":"$(wd+2) $(wd+3) $(wd+4) $(wd+5)"("hexToDecimal($wd $(wd+1))":"hexToDecimal($(wd+2) $(wd+3) $(wd+4) $(wd+5))")"; wd+=6 |
---|
| 377 | } |
---|
| 378 | nval-- |
---|
| 379 | } |
---|
| 380 | } |
---|
| 381 | tok[tokens] = tok[tokens]" subl="$(wd+1) $wd"]"; wd+=2 |
---|
| 382 | } |
---|
| 383 | else if (ch == "v") |
---|
| 384 | { |
---|
| 385 | tok[tokens] = "(len="$(wd+3) $(wd+2) $(wd+1) $wd")"; wd+=4 |
---|
| 386 | while (NF >= wd && $NF == "00") |
---|
| 387 | NF-- |
---|
| 388 | while (wd <= NF-3) |
---|
| 389 | { |
---|
| 390 | tok[tokens] = tok[tokens]" "$wd $(wd+1) $(wd+2) $(wd+3); wd+=4 |
---|
| 391 | } |
---|
| 392 | while (wd <= NF-1) |
---|
| 393 | { |
---|
| 394 | tok[tokens] = tok[tokens]" "$wd $(wd+1); wd+=2 |
---|
| 395 | } |
---|
| 396 | while (wd <= NF) |
---|
| 397 | { |
---|
| 398 | tok[tokens] = tok[tokens]" "$wd; wd++ |
---|
| 399 | } |
---|
| 400 | } |
---|
| 401 | } |
---|
| 402 | if (debug) print ch"="tok[tokens] |
---|
| 403 | } |
---|
| 404 | rest="" |
---|
| 405 | while (NF >= wd && $NF == "00") |
---|
| 406 | NF-- |
---|
| 407 | while (wd <= NF) |
---|
| 408 | { |
---|
| 409 | rest = rest" "$wd; wd++ |
---|
| 410 | } |
---|
| 411 | if (code == 101) # FSErrInconsistentInode |
---|
| 412 | { |
---|
| 413 | tok[1]="inodeNum="tok[1]"("hexToDecimal(tok[1])")" |
---|
| 414 | tok[2]="allocBlks="tok[2] |
---|
| 415 | tok[3]="lastBlock="tok[3] |
---|
| 416 | tok[4]="fragSubbl="tok[4] |
---|
| 417 | tok[5]="inode="tok[5] |
---|
| 418 | } |
---|
| 419 | else if (code == 102) # FSErrIndirectBlock |
---|
| 420 | { |
---|
| 421 | tok[1]="da="tok[1] |
---|
| 422 | tok[2]="gen="tok[2] |
---|
| 423 | tok[3]="inodeNum="tok[3]"("hexToDecimal(tok[3])")" |
---|
| 424 | tok[4]="expectBlkNum="tok[4] |
---|
| 425 | tok[5]="indBlock="tok[5] |
---|
| 426 | } |
---|
| 427 | else if (code == 104) # FSErrBadReplicationCounts |
---|
| 428 | { |
---|
| 429 | tok[1]="inodeNum="tok[1]"("hexToDecimal(tok[1])")" |
---|
| 430 | tok[2]="inode="tok[2] |
---|
| 431 | } |
---|
| 432 | else if (code == 105) # FSErrBadPtrReplications |
---|
| 433 | { |
---|
| 434 | tok[1]="inodeNum="tok[1]"("hexToDecimal(tok[1])")" |
---|
| 435 | tok[2]="dataPtrsPerInode="tok[2] |
---|
| 436 | tok[3]="indPtrsPerInode="tok[3] |
---|
| 437 | tok[4]="dataPtrsPerIndBlk="tok[4] |
---|
| 438 | tok[5]="inode="tok[5] |
---|
| 439 | } |
---|
| 440 | else if (code == 106) # FSErrIndirectionLevel |
---|
| 441 | { |
---|
| 442 | tok[1]="inodeNum="tok[1]"("hexToDecimal(tok[1])")" |
---|
| 443 | tok[2]="invalIndLvl="tok[2] |
---|
| 444 | tok[3]="inode="tok[3] |
---|
| 445 | } |
---|
| 446 | else if (code == 107) # FSErrDeallocBlock |
---|
| 447 | { |
---|
| 448 | tok[1]="errno="tok[1] |
---|
| 449 | tok[2]="diskNum="tok[2] |
---|
| 450 | if (wide || tok[4] > 32) # subblocks too big, assume 8 byte sector number |
---|
| 451 | { |
---|
| 452 | tok[3]="sector="tok[3] tok[4] |
---|
| 453 | tok[4]="nSubblocks="tok[5] |
---|
| 454 | tok[5]="region="tok[6] |
---|
| 455 | tok[6]="segment="tok[7] |
---|
| 456 | tok[7]="subBlock="tok[8] |
---|
| 457 | } |
---|
| 458 | else # assume 4 byte sector number |
---|
| 459 | { |
---|
| 460 | tok[3]="sector="tok[3] |
---|
| 461 | tok[4]="nSubblocks="tok[4] |
---|
| 462 | tok[5]="region="tok[5] |
---|
| 463 | tok[6]="segment="tok[6] |
---|
| 464 | tok[7]="subBlock="tok[7] |
---|
| 465 | } |
---|
| 466 | } |
---|
| 467 | else if (code == 108) # FSErrValidate |
---|
| 468 | { |
---|
| 469 | type=valtype[tok[1]+0] |
---|
| 470 | if (type == "") type=tok[1] |
---|
| 471 | tok[1]="type="type |
---|
| 472 | tok[2]="da="tok[2] |
---|
| 473 | tok[3]="sectors="tok[3] |
---|
| 474 | tok[4]="repda="tok[4] |
---|
| 475 | tok[5]="data="tok[5] |
---|
| 476 | } |
---|
| 477 | else if (code == 109) # FSErrBadDiskAddrIndex |
---|
| 478 | { |
---|
| 479 | tok[1]="da="tok[1] |
---|
| 480 | type=buftype[tok[2]+0] |
---|
| 481 | if (type == "") type=tok[2] |
---|
| 482 | tok[2]="type="type |
---|
| 483 | } |
---|
| 484 | else if (code == 110) # FSErrBadDiskAddrSector |
---|
| 485 | { |
---|
| 486 | tok[1]="da="tok[1] |
---|
| 487 | tok[2]="sectors="tok[2] |
---|
| 488 | type=buftype[hexToDecimal(tok[3])] |
---|
| 489 | if (type == "") type=tok[3] |
---|
| 490 | tok[3]="type="type |
---|
| 491 | } |
---|
| 492 | else if (code == 111) # FSErrBadDirBlock |
---|
| 493 | { |
---|
| 494 | tok[1]="inodeNum="tok[1]"("hexToDecimal(tok[1])")" |
---|
| 495 | tok[2]="blockNum="tok[2] |
---|
| 496 | tok[3]="errorcode="tok[3] |
---|
| 497 | tok[4]="errno="tok[4] |
---|
| 498 | tok[5]="dirhdr="tok[5] |
---|
| 499 | # and pick up tok[6 7 8 9] |
---|
| 500 | } |
---|
| 501 | else if (code == 112) # FSErrBadInodeStatus |
---|
| 502 | { |
---|
| 503 | tok[1]="inodeNum="tok[1]"("hexToDecimal(tok[1])")" |
---|
| 504 | tok[2]="inode="tok[2] |
---|
| 505 | } |
---|
| 506 | else if (code == 113) # FSErrBadInodeOrGen |
---|
| 507 | { |
---|
| 508 | tok[1]="fileInodeNum="tok[1]"("hexToDecimal(tok[1])")" |
---|
| 509 | tok[2]="dirInodeNum="tok[2]"("hexToDecimal(tok[2])")" |
---|
| 510 | tok[3]="gen="tok[3] |
---|
| 511 | tok[4]="filename="tok[4] |
---|
| 512 | } |
---|
| 513 | else if (code == 114) # FSErrAllocBlock |
---|
| 514 | { |
---|
| 515 | type=allerrtype[tok[1]] |
---|
| 516 | if (type == "") type=tok[1] |
---|
| 517 | tok[1]="type="type |
---|
| 518 | tok[2]="diskIndex="tok[2] |
---|
| 519 | tok[3]="recordNo="tok[3] |
---|
| 520 | tok[4]="nSubblocks="tok[4] |
---|
| 521 | } |
---|
| 522 | else if (code == 115) # FSErrBadDittoAddr |
---|
| 523 | { |
---|
| 524 | tok[1]="inodeNum="tok[1]"("hexToDecimal(tok[1])")" |
---|
| 525 | tok[2]="gen="tok[2] |
---|
| 526 | tok[3]="snapId="tok[3] |
---|
| 527 | tok[4]="inodeStatus="tok[4] |
---|
| 528 | tok[5]="InodeNumPrevSnap="tok[5]"("hexToDecimal(tok[5])")" |
---|
| 529 | tok[6]="genPrevSnap="tok[6] |
---|
| 530 | tok[7]="snapIdPrevSnap="tok[7] |
---|
| 531 | tok[8]="inodeStatusPrevSnap="tok[8] |
---|
| 532 | tok[9]="blockNum="tok[9] |
---|
| 533 | } |
---|
| 534 | else if (code == 116) # FSErrSnapInodeModified |
---|
| 535 | { |
---|
| 536 | tok[1]="inodeNum="tok[1]"("hexToDecimal(tok[1])")" |
---|
| 537 | tok[2]="snapId="tok[2] |
---|
| 538 | tok[3]="nextSnapId="tok[3] |
---|
| 539 | tok[4]="fileModifiedSnapId="tok[4] |
---|
| 540 | tok[5]="inode="tok[5] |
---|
| 541 | } |
---|
| 542 | else if (code == 201) # DirErrCheckHeaderFailed |
---|
| 543 | { |
---|
| 544 | tok[1]="inodeNum="tok[1]"("hexToDecimal(tok[1])")" |
---|
| 545 | tok[2]="snapId="tok[2] |
---|
| 546 | tok[3]="blockNum="tok[3] |
---|
| 547 | tok[4]="errorcode="tok[4] |
---|
| 548 | tok[5]="rc="tok[5] |
---|
| 549 | tok[6]="dirhdr="tok[6] |
---|
| 550 | # and pick up tok[7 8 9 10 11] |
---|
| 551 | } |
---|
| 552 | else if (code == 202) # DirErrDotDotNotFound |
---|
| 553 | { |
---|
| 554 | tok[1]="errorcode="tok[1] |
---|
| 555 | tok[2]="rc="tok[2] |
---|
| 556 | tok[3]="srcInodeNum="tok[3]"("hexToDecimal(tok[3])")" |
---|
| 557 | tok[4]="srcGen="tok[4] |
---|
| 558 | } |
---|
| 559 | else if (code == 203) # DirErrGenNumMismatch |
---|
| 560 | { |
---|
| 561 | tok[1]="errorcode="tok[1] |
---|
| 562 | tok[2]="rc="tok[2] |
---|
| 563 | tok[3]="srcInodeNum="tok[3]"("hexToDecimal(tok[3])")" |
---|
| 564 | tok[4]="srcGen="tok[4] |
---|
| 565 | tok[5]="entryGen="tok[5] |
---|
| 566 | } |
---|
| 567 | else if (code == 204) # DirErrInodeNumMismatch |
---|
| 568 | { |
---|
| 569 | tok[1]="errorcode="tok[1] |
---|
| 570 | tok[2]="rc="tok[2] |
---|
| 571 | tok[3]="srcInodeNum="tok[3]"("hexToDecimal(tok[3])")" |
---|
| 572 | tok[4]="entryInodeNum="tok[4]"("hexToDecimal(tok[4])")" |
---|
| 573 | } |
---|
| 574 | else if (code == 205) # DirErrInodeCorrupted |
---|
| 575 | { |
---|
| 576 | tok[3]="inodeNum="tok[3]"("hexToDecimal(tok[3])")" |
---|
| 577 | tok[4]="srcGen="tok[4] |
---|
| 578 | tok[5]="entryGen="tok[5] |
---|
| 579 | tok[6]="entryInodeStatus="tok[6] |
---|
| 580 | } |
---|
| 581 | else if (code == 206) # DirErrDirectCorrupted |
---|
| 582 | { |
---|
| 583 | tok[1]="inodeNum="tok[1]"("hexToDecimal(tok[1])")" |
---|
| 584 | tok[2]="blockNum="tok[2] |
---|
| 585 | tok[3]="errorcode="tok[3] |
---|
| 586 | tok[4]="errno="tok[4] |
---|
| 587 | tok[5]="dirhdr="tok[5] |
---|
| 588 | # and pick up tok[6 7 8 9] |
---|
| 589 | } |
---|
| 590 | |
---|
| 591 | printf("%s %s %s %s %s %s", |
---|
| 592 | date, node, "FSSTRUCT", vol, code, name[code]) |
---|
| 593 | for (i = 1; i <= tokens; i++) |
---|
| 594 | printf(" %s", tok[i]) |
---|
| 595 | if (rest != "") printf(" rest =%s\n", rest) |
---|
| 596 | else printf("\n") |
---|
| 597 | } |
---|
| 598 | } |
---|
| 599 | } |
---|
| 600 | END { |
---|
| 601 | if (terminate) exit 1 |
---|
| 602 | for (tag=1; tag <= tags; tag++) |
---|
| 603 | print_gpfstag(taglist[tag]) |
---|
| 604 | for (code in count) |
---|
| 605 | printf("+++code: %4d %s %9d times\n", code, name[code], count[code]) |
---|
| 606 | } |
---|