io = vvp_env_thread_io(env);
if (file->f_flags & O_DIRECT) {
+ if (file->f_flags & O_APPEND)
+ dio_lock = 1;
if (!is_sync_kiocb(args->u.normal.via_iocb))
is_aio = true;
$LCTL set_param ldlm.namespaces.*-OST0000-osc-ffff*.lru_size=clear
- # no lock cached, should use lockless IO and not enqueue new lock
+ # no lock cached, should use lockless DIO and not enqueue new lock
dd if=/dev/zero of=$DIR/$tfile bs=1M count=1 oflag=direct conv=notrunc
lock_count=$($LCTL get_param -n \
ldlm.namespaces.$imp_name.lru_size)
[[ $lock_count -eq 0 ]] || error "no lock should be held by direct IO"
+
+ $LCTL set_param ldlm.namespaces.*-OST0000-osc-ffff*.lru_size=clear
+
+ # no lock cached, should use locked DIO append
+ dd if=/dev/zero of=$DIR/$tfile bs=1M count=1 oflag=direct oflag=append \
+ conv=notrunc || error "DIO append failed"
+ lock_count=$($LCTL get_param -n \
+ ldlm.namespaces.*-OST0000-osc-ffff*.lru_size)
+ [[ $lock_count -ne 0 ]] || error "lock still must be held by DIO append"
}
run_test 398a "direct IO should cancel lock otherwise lockless"