if (oa->o_valid & OBD_MD_FLATIME) {
rec->sa_atime = oa->o_atime;
- rec->sa_valid |= MDS_ATTR_ATIME;
+ rec->sa_valid |= MDS_ATTR_ATIME | MDS_ATTR_ATIME_SET;
}
if (oa->o_valid & OBD_MD_FLMTIME) {
rec->sa_mtime = oa->o_mtime;
- rec->sa_valid |= MDS_ATTR_MTIME;
+ rec->sa_valid |= MDS_ATTR_MTIME | MDS_ATTR_MTIME_SET;
}
if (oa->o_valid & OBD_MD_FLCTIME) {
rec->sa_ctime = oa->o_ctime;
- rec->sa_valid |= MDS_ATTR_CTIME;
+ rec->sa_valid |= MDS_ATTR_CTIME | MDS_ATTR_CTIME_SET;
}
if (oa->o_valid & OBD_MD_FLSIZE) {
rec->sa_size = oa->o_size;
}
run_test 202 "O_APPEND+O_DIRECT multistripe write ========================"
-test_203() {
- local lustre_version=$(get_lustre_version mds)
- if [[ $lustre_version != 1.8* ]]; then
- skip bug23766 mds running $lustre_version
- return
- fi
-
- local ATIME=`do_facet mds lctl get_param -n mds.*.atime_diff`
- echo "atime should be updated on the MDS when closing file" > $DIR/$tfile
- sync
- # reads should update atime on the client and close should update it on the MDS
- multiop_bg_pause $DIR/$tfile o_r20c || return 1
- MULTIPID=$!
- sleep $((ATIME+1))
- time1=`date +%s`
- log "now is $time1"
- kill -USR1 $MULTIPID || return 2
- echo "starting reads"
- wait
- cancel_lru_locks osc
- cancel_lru_locks mdc
- time2=`stat -c "%X" $DIR/$tfile`
- log "new atime is $time2"
- [ "$time2" -ge "$time1" ] || error "atime was not updated"
-}
-run_test 203 " atime should be updated on the MDS when closing file ===="
-
# usage: default_attr <count | size | offset>
default_attr() {
$LCTL get_param -n lov.$FSNAME-clilov-\*.stripe${1}
run_test 22 " After joining in one dir, open/close unlink file in anther dir"
test_23() { # Bug 5972
- echo "others should see updated atime while another read" > $DIR1/f23
+ local atime_diff=$(do_facet mds $LCTL get_param -n md*.*.atime_diff)
+ echo "should see updated atime while another read" > $DIR1/$tfile
# clear the lock(mode: LCK_PW) gotten from creating operation
cancel_lru_locks osc
+ time1=$(date +%s)
+ echo "now is $time1"
+ sleep $((atime_diff + 1))
- time1=`date +%s`
- sleep 2
-
- multiop_bg_pause $DIR1/f23 or20_c || return 1
- MULTIPID=$!
-
- time2=`stat -c "%X" $DIR2/f23`
+ multiop_bg_pause $DIR1/$tfile or20_c || return 1
+ kill -USR1 $! || return 2
+ wait
+ cancel_lru_locks mdc
- if (( $time2 <= $time1 )); then
- kill -USR1 $MULTIPID
- error "atime doesn't update among nodes"
- fi
+ time2=$(stat -c "%X" $DIR2/$tfile)
+ echo "new atime is $time2"
- kill -USR1 $MULTIPID || return 1
- rm -f $DIR1/f23 || error "rm -f $DIR1/f23 failed"
+ [ $time2 -gt $time1 ] || error "atime doesn't update among nodes"
+ rm -f $DIR1/$tfile || error "rm -f $DIR1/$tfile failed"
true
}
run_test 23 " others should see updated atime while another read===="