With huge number of pages to scan by osc_lock_weight() it is likely
CLP_GANG_RESCHED is returned from osc_page_gang_lookup() and the scan
will be repeated again from the start. To be sure that the scan is
progressing across those restarts, next scan should be started from
the last scanned page index plus one.
Xyratex-bug-id: MRP-2145
Signed-off-by: Alexander Zarochentsev <alexander.zarochentsev@seagate.com>
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-on: http://review.whamcloud.com/12362
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5781
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (cl_page_is_vmlocked(env, page) ||
PageDirty(page->cp_vmpage) || PageWriteback(page->cp_vmpage)
if (cl_page_is_vmlocked(env, page) ||
PageDirty(page->cp_vmpage) || PageWriteback(page->cp_vmpage)
- ) {
- (*(unsigned long *)cbdata)++;
+ *(pgoff_t *)cbdata = osc_index(ops) + 1;
{
struct cl_io *io = &osc_env_info(env)->oti_io;
struct cl_object *obj = cl_object_top(&oscobj->oo_cl);
{
struct cl_io *io = &osc_env_info(env)->oti_io;
struct cl_object *obj = cl_object_top(&oscobj->oo_cl);
- unsigned long npages = 0;
int result;
io->ci_obj = obj;
int result;
io->ci_obj = obj;
if (result != 0)
return result;
if (result != 0)
return result;
+ page_index = cl_index(obj, extent->start);
do {
result = osc_page_gang_lookup(env, io, oscobj,
do {
result = osc_page_gang_lookup(env, io, oscobj,
- cl_index(obj, extent->start),
cl_index(obj, extent->end),
cl_index(obj, extent->end),
- weigh_cb, (void *)&npages);
+ weigh_cb, (void *)&page_index);
if (result == CLP_GANG_ABORT)
break;
if (result == CLP_GANG_RESCHED)
if (result == CLP_GANG_ABORT)
break;
if (result == CLP_GANG_RESCHED)
} while (result != CLP_GANG_OKAY);
cl_io_fini(env, io);
} while (result != CLP_GANG_OKAY);
cl_io_fini(env, io);
+ return result == CLP_GANG_ABORT ? 1 : 0;