• Darrick J. Wong's avatar
    xfs: report ag header corruption errors to the health tracking system · de6077ec
    Darrick J. Wong authored
    Whenever we encounter a corrupt AG header, we should report that to the
    health monitoring system for later reporting.  Buffer readers that don't
    respond to corruption events with a _mark_sick call can be detected with
    the following script:
    
    #!/bin/bash
    
    # Detect missing calls to xfs_*_mark_sick
    
    filter=cat
    tty -s && filter=less
    
    git grep -A10  -E '( = xfs_trans_read_buf| = xfs_buf_read\()' fs/xfs/*.[ch] fs/xfs/libxfs/*.[ch] | awk '
    BEGIN {
    	ignore = 0;
    	lineno = 0;
    	delete lines;
    }
    {
    	if ($0 == "--") {
    		if (!ignore) {
    			for (i = 0; i < lineno; i++) {
    				print(lines[i]);
    			}
    			printf("--\n");
    		}
    		delete lines;
    		lineno = 0;
    		ignore = 0;
    	} else if ($0 ~ /mark_sick/) {
    		ignore = 1;
    	} else {
    		lines[lineno++] = $0;
    	}
    }
    ' | $filter
    Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    de6077ec
xfs_alloc.c 108 KB