ext->oe_memalloc = 1;
ext->oe_urgent = 1;
- if (ext->oe_state == OES_CACHE && cfs_list_empty(&ext->oe_link)) {
+ if (ext->oe_state == OES_CACHE) {
OSC_EXTENT_DUMP(D_CACHE, ext,
"flush page %p make it urgent.\n", oap);
- cfs_list_add_tail(&ext->oe_link, &obj->oo_urgent_exts);
+ if (cfs_list_empty(&ext->oe_link))
+ cfs_list_add_tail(&ext->oe_link, &obj->oo_urgent_exts);
unplug = true;
}
rc = 0;
break;
}
+ OSC_EXTENT_DUMP(D_CACHE, ext, "try to trunc:"LPU64".\n", size);
+
osc_extent_get(ext);
if (ext->oe_state == OES_ACTIVE) {
/* though we grab inode mutex for write path, but we
osc_extent_put(env, ext);
}
if (waiting != NULL) {
- if (result == 0)
- result = osc_extent_wait(env, waiting, OES_INV);
+ int rc;
+
+ /* ignore the result of osc_extent_wait the write initiator
+ * should take care of it. */
+ rc = osc_extent_wait(env, waiting, OES_INV);
+ if (rc < 0)
+ OSC_EXTENT_DUMP(D_CACHE, ext, "wait error: %d.\n", rc);
osc_extent_put(env, waiting);
waiting = NULL;
- if (result == 0)
- goto again;
+ goto again;
}
RETURN(result);
}
ext->oe_urgent = 1;
list = &obj->oo_urgent_exts;
}
- if (list != NULL) {
+ if (list != NULL)
cfs_list_move_tail(&ext->oe_link, list);
- unplug = true;
- }
+ unplug = true;
} else {
/* the only discarder is lock cancelling, so
* [start, end] must contain this extent */