fsfilt_check_slow(obd, now, "start_page_write");
+ lprocfs_counter_add(obd->obd_stats, LPROC_FILTER_WRITE_BYTES,
+ tot_bytes);
+
if (exp->exp_nid_stats && exp->exp_nid_stats->nid_stats)
lprocfs_counter_add(exp->exp_nid_stats->nid_stats,
LPROC_FILTER_WRITE_BYTES, tot_bytes);
}
run_test 33b "test open file with malformed flags (No panic and return error)"
+test_33c() {
+ local ostnum
+ local ostname
+ local write_bytes
+ local all_zeros
+
+ all_zeros=:
+ rm -fr $DIR/d33
+ mkdir -p $DIR/d33
+ # Read: 0, Write: 4, create/destroy: 2/0, stat: 1, punch: 0
+
+ sync
+ for ostnum in $(seq $OSTCOUNT); do
+ # test-framework's OST numbering is one-based, while Lustre's
+ # is zero-based
+ ostname=$(printf "lustre-OST%.4d" $((ostnum - 1)))
+ # Parsing llobdstat's output sucks; we could grep the /proc
+ # path, but that's likely to not be as portable as using the
+ # llobdstat utility. Besides, this way we also test that
+ # utility.
+ write_bytes=$(do_facet ost$ostnum $LLOBDSTAT $ostname |
+ sed -e 's/^.*, Write: \([0-9][0-9]*\),.*$/\1/' |
+ grep '^[0-9]*$')
+ if (( ${write_bytes:-0} > 0 ))
+ then
+ all_zeros=false
+ break;
+ fi
+ done
+
+ $all_zeros || return 0
+
+ # Write four bytes
+ echo foo > $DIR/d33/bar
+ # Really write them
+ sync
+
+ # Total up write_bytes after writing. We'd better find non-zeros.
+ for ostnum in $(seq $OSTCOUNT); do
+ ostname=$(printf "lustre-OST%.4d" $ostnum)
+ write_bytes=$(do_facet ost$ostnum $LLOBDSTAT $ostname |
+ sed -e 's/^.*, Write: \([0-9][0-9]*\),.*$/\1/' |
+ grep '^[0-9]*$')
+ if (( ${write_bytes:-0} > 0 ))
+ then
+ all_zeros=false
+ break;
+ fi
+ done
+
+ $all_zeros && error "OST not keeping write_bytes stats (b22312)"
+}
+run_test 33c "test llobdstat and write_bytes"
+
TEST_34_SIZE=${TEST_34_SIZE:-2000000000000}
test_34a() {
rm -f $DIR/f34
. $EXCEPT_LIST_FILE
fi
+if [[ -x $LUSTRE/utils/llobdstat ]]; then
+ LLOBDSTAT=$LUSTRE/utils/llobdstat
+elif [[ -x /usr/bin/llobdstat ]]; then
+ LLOBDSTAT=/usr/bin/llobdstat
+else
+ # Good luck
+ LLOBDSTAT=llobdstat
+fi
+
[ -z "$MODPROBECONF" -a -f /etc/modprobe.conf ] && MODPROBECONF=/etc/modprobe.conf
[ -z "$MODPROBECONF" -a -f /etc/modprobe.d/Lustre ] && MODPROBECONF=/etc/modprobe.d/Lustre
} elsif ( -f "$ARGV[0]/$obdstats" ) {
$statspath = "$ARGV[0]/$obdstats";
} else {
- my $st = `ls $defaultpath/obdfilter/$ARGV[0]/$obdstats 2> /dev/null`;
- chop $st;
- if ( -f "$st" ) {
- $statspath = $st;
- }
+ my $st = "$defaultpath/obdfilter/$ARGV[0]/$obdstats";
+ if ( -f "$st" ) {
+ $statspath = $st;
+ }
}
if ( $statspath =~ /^None$/ ) {
die "Cannot locate stat file for: $ARGV[0]\n";