Do not allow different type of pages at the same rpc.
Signed-off-by: Alexander Boyko <alexander_boyko@xyratex.com>
Signed-off-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Xyratex-bug-id: MRP-859
Change-Id: Ic595a29f685757faf4d9c3de9c2d2ae8fd039baf
Reviewed-on: http://review.whamcloud.com/10930
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
int *pc, unsigned int *max_pages)
{
struct osc_extent *tmp;
int *pc, unsigned int *max_pages)
{
struct osc_extent *tmp;
+ struct osc_async_page *oap = list_first_entry(&ext->oe_pages,
+ struct osc_async_page,
+ oap_pending_item);
ENTRY;
EASSERT((ext->oe_state == OES_CACHE || ext->oe_state == OES_LOCK_DONE),
ENTRY;
EASSERT((ext->oe_state == OES_CACHE || ext->oe_state == OES_LOCK_DONE),
RETURN(0);
list_for_each_entry(tmp, rpclist, oe_link) {
RETURN(0);
list_for_each_entry(tmp, rpclist, oe_link) {
+ struct osc_async_page *oap2;
+ oap2 = list_first_entry(&tmp->oe_pages, struct osc_async_page,
+ oap_pending_item);
EASSERT(tmp->oe_owner == current, tmp);
#if 0
if (overlapped(tmp, ext)) {
EASSERT(tmp->oe_owner == current, tmp);
#if 0
if (overlapped(tmp, ext)) {
EASSERT(0, ext);
}
#endif
EASSERT(0, ext);
}
#endif
+ if (oap2cl_page(oap)->cp_type != oap2cl_page(oap2)->cp_type) {
+ CDEBUG(D_CACHE, "Do not permit different type of IO"
+ " for a same RPC\n");
+ RETURN(0);
+ }
if (tmp->oe_srvlock != ext->oe_srvlock ||
!tmp->oe_grants != !ext->oe_grants)
if (tmp->oe_srvlock != ext->oe_srvlock ||
!tmp->oe_grants != !ext->oe_grants)
}
run_test 240 "race between ldlm enqueue and the connection RPC (no ASSERT)"
}
run_test 240 "race between ldlm enqueue and the connection RPC (no ASSERT)"
+test_241_bio() {
+ for LOOP in $(seq $1); do
+ dd if=$DIR/$tfile of=/dev/null bs=40960 count=1 2>/dev/null
+ cancel_lru_locks osc
+ done
+}
+
+test_241_dio() {
+ for LOOP in $(seq $1); do
+ dd if=$DIR/$tfile of=/dev/null bs=40960 count=1 \
+ iflag=direct 2>/dev/null
+ done
+}
+
+test_241() {
+ dd if=/dev/zero of=$DIR/$tfile count=1 bs=40960
+ ls -la $DIR/$tfile
+ cancel_lru_locks osc
+ test_241_bio 1000 &
+ PID=$!
+ test_241_dio 1000
+ wait $PID
+}
+run_test 241 "bio vs dio"
+
cleanup_test_300() {
trap 0
umask $SAVE_UMASK
cleanup_test_300() {
trap 0
umask $SAVE_UMASK