Commit f13ab92e authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

staging: lustre: fix to use list_for_each_entry_safe() when delete items

Since we will remove items off the list using list_del_init() we need
to use a safe version of the list_for_each_entry() macro aptly named
list_for_each_entry_safe().
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 49c144c8
...@@ -2620,7 +2620,7 @@ int osc_queue_sync_pages(const struct lu_env *env, struct osc_object *obj, ...@@ -2620,7 +2620,7 @@ int osc_queue_sync_pages(const struct lu_env *env, struct osc_object *obj,
{ {
struct client_obd *cli = osc_cli(obj); struct client_obd *cli = osc_cli(obj);
struct osc_extent *ext; struct osc_extent *ext;
struct osc_async_page *oap; struct osc_async_page *oap, *tmp;
int page_count = 0; int page_count = 0;
int mppr = cli->cl_max_pages_per_rpc; int mppr = cli->cl_max_pages_per_rpc;
pgoff_t start = CL_PAGE_EOF; pgoff_t start = CL_PAGE_EOF;
...@@ -2639,7 +2639,7 @@ int osc_queue_sync_pages(const struct lu_env *env, struct osc_object *obj, ...@@ -2639,7 +2639,7 @@ int osc_queue_sync_pages(const struct lu_env *env, struct osc_object *obj,
ext = osc_extent_alloc(obj); ext = osc_extent_alloc(obj);
if (ext == NULL) { if (ext == NULL) {
list_for_each_entry(oap, list, oap_pending_item) { list_for_each_entry_safe(oap, tmp, list, oap_pending_item) {
list_del_init(&oap->oap_pending_item); list_del_init(&oap->oap_pending_item);
osc_ap_completion(env, cli, oap, 0, -ENOMEM); osc_ap_completion(env, cli, oap, 0, -ENOMEM);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment