In sanity.sh, subtest 151 checks whether the page written previously
is in cache or not, this patch disable the LRU of objects in OST to
avoid the object and its content(pages) to be dropped.
Change-Id: Ie481d13215dac599e0b7e122fcc7e9819a053af5
Signed-off-by: Hongchao Zhang <hongchao.zhang@intel.com>
Reviewed-on: http://review.whamcloud.com/5475
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.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>
#define OBD_FAIL_OBD_LOG_CANCEL_REP 0x606
#define OBD_FAIL_OBD_IDX_READ_NET 0x607
#define OBD_FAIL_OBD_IDX_READ_BREAK 0x608
#define OBD_FAIL_OBD_LOG_CANCEL_REP 0x606
#define OBD_FAIL_OBD_IDX_READ_NET 0x607
#define OBD_FAIL_OBD_IDX_READ_BREAK 0x608
+#define OBD_FAIL_OBD_NO_LRU 0x609
#define OBD_FAIL_TGT_REPLY_NET 0x700
#define OBD_FAIL_TGT_CONN_RACE 0x701
#define OBD_FAIL_TGT_REPLY_NET 0x700
#define OBD_FAIL_TGT_CONN_RACE 0x701
+ if (OBD_FAIL_CHECK(OBD_FAIL_OBD_NO_LRU))
+ RETURN(0);
+
CFS_INIT_LIST_HEAD(&dispose);
/*
* Under LRU list lock, scan LRU list and move unreferenced objects to
CFS_INIT_LIST_HEAD(&dispose);
/*
* Under LRU list lock, scan LRU list and move unreferenced objects to
set_osd_param $list '' writethrough_cache_enable 1
set_osd_param $list '' writethrough_cache_enable 1
- # pages should be in the case right after write
- dd if=/dev/urandom of=$DIR/$tfile bs=4k count=$CPAGES || error "dd failed"
- local BEFORE=`roc_hit`
- cancel_lru_locks osc
- cat $DIR/$tfile >/dev/null
- local AFTER=`roc_hit`
- if ! let "AFTER - BEFORE == CPAGES"; then
- error "NOT IN CACHE: before: $BEFORE, after: $AFTER"
- fi
+ # check write cache is enabled on all obdfilters
+ if get_osd_param $list '' writethrough_cache_enable | grep 0; then
+ echo "oss write cache is NOT enabled"
+ return 0
+ fi
+
+#define OBD_FAIL_OBD_NO_LRU 0x609
+ do_nodes $list $LCTL set_param fail_loc=0x609
+
+ # pages should be in the case right after write
+ dd if=/dev/urandom of=$DIR/$tfile bs=4k count=$CPAGES ||
+ error "dd failed"
+
+ local BEFORE=`roc_hit`
+ cancel_lru_locks osc
+ cat $DIR/$tfile >/dev/null
+ local AFTER=`roc_hit`
+
+ do_nodes $list $LCTL set_param fail_loc=0
+
+ if ! let "AFTER - BEFORE == CPAGES"; then
+ error "NOT IN CACHE: before: $BEFORE, after: $AFTER"
+ fi
# the following read invalidates the cache
cancel_lru_locks osc
# the following read invalidates the cache
cancel_lru_locks osc