aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fscache
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2015-02-24 05:05:29 -0500
committerDavid Howells <dhowells@redhat.com>2015-04-02 09:28:53 -0400
commitd3b97ca4a99e4e6c78f5a21c968eadf5c8ba9971 (patch)
treeceae1c413126e7dc02ff40836d779a0b3b28ae99 /fs/fscache
parenta39caadf06879017cb9a8c5c5cb4fc4ccb213275 (diff)
FS-Cache: The operation cancellation method needs calling in more places
Any time an incomplete operation is cancelled, the operation cancellation function needs to be called to clean up. This is currently being passed directly to some of the functions that might want to call it, but not all. Instead, pass the cancellation method pointer to the fscache_operation_init() and have that cache it in the operation struct. Further, plug in a dummy cancellation handler if the caller declines to set one as this allows us to call the function unconditionally (the extra overhead isn't worth bothering about as we don't expect to be calling this typically). The cancellation method must thence be called everywhere the CANCELLED state is set. Note that we call it *before* setting the CANCELLED state such that the method can use the old state value to guide its operation. fscache_do_cancel_retrieval() needs moving higher up in the sources so that the init function can use it now. Without this, the following oops may be seen: FS-Cache: Assertion failed FS-Cache: 3 == 0 is false ------------[ cut here ]------------ kernel BUG at ../fs/fscache/page.c:261! ... RIP: 0010:[<ffffffffa0089c1b>] fscache_release_retrieval_op+0x77/0x100 [<ffffffffa008853d>] fscache_put_operation+0x114/0x2da [<ffffffffa008b8c2>] __fscache_read_or_alloc_pages+0x358/0x3b3 [<ffffffffa00b761f>] __nfs_readpages_from_fscache+0x59/0xbf [nfs] [<ffffffffa00b06c5>] nfs_readpages+0x10c/0x185 [nfs] [<ffffffff81124925>] ? alloc_pages_current+0x119/0x13e [<ffffffff810ee5fd>] ? __page_cache_alloc+0xfb/0x10a [<ffffffff810f87f8>] __do_page_cache_readahead+0x188/0x22c [<ffffffff810f8b3a>] ondemand_readahead+0x29e/0x2af [<ffffffff810f8c92>] page_cache_sync_readahead+0x38/0x3a [<ffffffff810ef337>] generic_file_read_iter+0x1a2/0x55a [<ffffffffa00a9dff>] ? nfs_revalidate_mapping+0xd6/0x288 [nfs] [<ffffffffa00a6a23>] nfs_file_read+0x49/0x70 [nfs] [<ffffffff811363be>] new_sync_read+0x78/0x9c [<ffffffff81137164>] __vfs_read+0x13/0x38 [<ffffffff8113721e>] vfs_read+0x95/0x121 [<ffffffff811372f6>] SyS_read+0x4c/0x8a [<ffffffff81557a52>] system_call_fastpath+0x12/0x17 The assertion is showing that the remaining number of pages (n_pages) is not 0 when the operation is being released. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Steve Dickson <steved@redhat.com> Acked-by: Jeff Layton <jeff.layton@primarydata.com>
Diffstat (limited to 'fs/fscache')
-rw-r--r--fs/fscache/cookie.c5
-rw-r--r--fs/fscache/internal.h7
-rw-r--r--fs/fscache/object.c3
-rw-r--r--fs/fscache/operation.c31
-rw-r--r--fs/fscache/page.c46
5 files changed, 52 insertions, 40 deletions
diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
index 8de22164f5fb..d403c69bee08 100644
--- a/fs/fscache/cookie.c
+++ b/fs/fscache/cookie.c
@@ -672,7 +672,7 @@ int __fscache_check_consistency(struct fscache_cookie *cookie)
672 if (!op) 672 if (!op)
673 return -ENOMEM; 673 return -ENOMEM;
674 674
675 fscache_operation_init(op, NULL, NULL); 675 fscache_operation_init(op, NULL, NULL, NULL);
676 op->flags = FSCACHE_OP_MYTHREAD | 676 op->flags = FSCACHE_OP_MYTHREAD |
677 (1 << FSCACHE_OP_WAITING) | 677 (1 << FSCACHE_OP_WAITING) |
678 (1 << FSCACHE_OP_UNUSE_COOKIE); 678 (1 << FSCACHE_OP_UNUSE_COOKIE);
@@ -696,8 +696,7 @@ int __fscache_check_consistency(struct fscache_cookie *cookie)
696 /* the work queue now carries its own ref on the object */ 696 /* the work queue now carries its own ref on the object */
697 spin_unlock(&cookie->lock); 697 spin_unlock(&cookie->lock);
698 698
699 ret = fscache_wait_for_operation_activation(object, op, 699 ret = fscache_wait_for_operation_activation(object, op, NULL, NULL);
700 NULL, NULL, NULL);
701 if (ret == 0) { 700 if (ret == 0) {
702 /* ask the cache to honour the operation */ 701 /* ask the cache to honour the operation */
703 ret = object->cache->ops->check_consistency(op); 702 ret = object->cache->ops->check_consistency(op);
diff --git a/fs/fscache/internal.h b/fs/fscache/internal.h
index a63225116db6..97ec45110957 100644
--- a/fs/fscache/internal.h
+++ b/fs/fscache/internal.h
@@ -124,9 +124,7 @@ extern int fscache_submit_exclusive_op(struct fscache_object *,
124 struct fscache_operation *); 124 struct fscache_operation *);
125extern int fscache_submit_op(struct fscache_object *, 125extern int fscache_submit_op(struct fscache_object *,
126 struct fscache_operation *); 126 struct fscache_operation *);
127extern int fscache_cancel_op(struct fscache_operation *, 127extern int fscache_cancel_op(struct fscache_operation *, bool);
128 void (*)(struct fscache_operation *),
129 bool);
130extern void fscache_cancel_all_ops(struct fscache_object *); 128extern void fscache_cancel_all_ops(struct fscache_object *);
131extern void fscache_abort_object(struct fscache_object *); 129extern void fscache_abort_object(struct fscache_object *);
132extern void fscache_start_operations(struct fscache_object *); 130extern void fscache_start_operations(struct fscache_object *);
@@ -139,8 +137,7 @@ extern int fscache_wait_for_deferred_lookup(struct fscache_cookie *);
139extern int fscache_wait_for_operation_activation(struct fscache_object *, 137extern int fscache_wait_for_operation_activation(struct fscache_object *,
140 struct fscache_operation *, 138 struct fscache_operation *,
141 atomic_t *, 139 atomic_t *,
142 atomic_t *, 140 atomic_t *);
143 void (*)(struct fscache_operation *));
144extern void fscache_invalidate_writes(struct fscache_cookie *); 141extern void fscache_invalidate_writes(struct fscache_cookie *);
145 142
146/* 143/*
diff --git a/fs/fscache/object.c b/fs/fscache/object.c
index 40049f7505f0..9e792e30f4db 100644
--- a/fs/fscache/object.c
+++ b/fs/fscache/object.c
@@ -961,7 +961,8 @@ static const struct fscache_state *_fscache_invalidate_object(struct fscache_obj
961 if (!op) 961 if (!op)
962 goto nomem; 962 goto nomem;
963 963
964 fscache_operation_init(op, object->cache->ops->invalidate_object, NULL); 964 fscache_operation_init(op, object->cache->ops->invalidate_object,
965 NULL, NULL);
965 op->flags = FSCACHE_OP_ASYNC | 966 op->flags = FSCACHE_OP_ASYNC |
966 (1 << FSCACHE_OP_EXCLUSIVE) | 967 (1 << FSCACHE_OP_EXCLUSIVE) |
967 (1 << FSCACHE_OP_UNUSE_COOKIE); 968 (1 << FSCACHE_OP_UNUSE_COOKIE);
diff --git a/fs/fscache/operation.c b/fs/fscache/operation.c
index c76c09730768..57d4abb68656 100644
--- a/fs/fscache/operation.c
+++ b/fs/fscache/operation.c
@@ -20,6 +20,10 @@
20atomic_t fscache_op_debug_id; 20atomic_t fscache_op_debug_id;
21EXPORT_SYMBOL(fscache_op_debug_id); 21EXPORT_SYMBOL(fscache_op_debug_id);
22 22
23static void fscache_operation_dummy_cancel(struct fscache_operation *op)
24{
25}
26
23/** 27/**
24 * fscache_operation_init - Do basic initialisation of an operation 28 * fscache_operation_init - Do basic initialisation of an operation
25 * @op: The operation to initialise 29 * @op: The operation to initialise
@@ -30,6 +34,7 @@ EXPORT_SYMBOL(fscache_op_debug_id);
30 */ 34 */
31void fscache_operation_init(struct fscache_operation *op, 35void fscache_operation_init(struct fscache_operation *op,
32 fscache_operation_processor_t processor, 36 fscache_operation_processor_t processor,
37 fscache_operation_cancel_t cancel,
33 fscache_operation_release_t release) 38 fscache_operation_release_t release)
34{ 39{
35 INIT_WORK(&op->work, fscache_op_work_func); 40 INIT_WORK(&op->work, fscache_op_work_func);
@@ -37,6 +42,7 @@ void fscache_operation_init(struct fscache_operation *op,
37 op->state = FSCACHE_OP_ST_INITIALISED; 42 op->state = FSCACHE_OP_ST_INITIALISED;
38 op->debug_id = atomic_inc_return(&fscache_op_debug_id); 43 op->debug_id = atomic_inc_return(&fscache_op_debug_id);
39 op->processor = processor; 44 op->processor = processor;
45 op->cancel = cancel ?: fscache_operation_dummy_cancel;
40 op->release = release; 46 op->release = release;
41 INIT_LIST_HEAD(&op->pend_link); 47 INIT_LIST_HEAD(&op->pend_link);
42 fscache_stat(&fscache_n_op_initialised); 48 fscache_stat(&fscache_n_op_initialised);
@@ -164,9 +170,11 @@ int fscache_submit_exclusive_op(struct fscache_object *object,
164 flags = READ_ONCE(object->flags); 170 flags = READ_ONCE(object->flags);
165 if (unlikely(!(flags & BIT(FSCACHE_OBJECT_IS_LIVE)))) { 171 if (unlikely(!(flags & BIT(FSCACHE_OBJECT_IS_LIVE)))) {
166 fscache_stat(&fscache_n_op_rejected); 172 fscache_stat(&fscache_n_op_rejected);
173 op->cancel(op);
167 op->state = FSCACHE_OP_ST_CANCELLED; 174 op->state = FSCACHE_OP_ST_CANCELLED;
168 ret = -ENOBUFS; 175 ret = -ENOBUFS;
169 } else if (unlikely(fscache_cache_is_broken(object))) { 176 } else if (unlikely(fscache_cache_is_broken(object))) {
177 op->cancel(op);
170 op->state = FSCACHE_OP_ST_CANCELLED; 178 op->state = FSCACHE_OP_ST_CANCELLED;
171 ret = -EIO; 179 ret = -EIO;
172 } else if (flags & BIT(FSCACHE_OBJECT_IS_AVAILABLE)) { 180 } else if (flags & BIT(FSCACHE_OBJECT_IS_AVAILABLE)) {
@@ -200,10 +208,12 @@ int fscache_submit_exclusive_op(struct fscache_object *object,
200 fscache_stat(&fscache_n_op_pend); 208 fscache_stat(&fscache_n_op_pend);
201 ret = 0; 209 ret = 0;
202 } else if (flags & BIT(FSCACHE_OBJECT_KILLED_BY_CACHE)) { 210 } else if (flags & BIT(FSCACHE_OBJECT_KILLED_BY_CACHE)) {
211 op->cancel(op);
203 op->state = FSCACHE_OP_ST_CANCELLED; 212 op->state = FSCACHE_OP_ST_CANCELLED;
204 ret = -ENOBUFS; 213 ret = -ENOBUFS;
205 } else { 214 } else {
206 fscache_report_unexpected_submission(object, op, ostate); 215 fscache_report_unexpected_submission(object, op, ostate);
216 op->cancel(op);
207 op->state = FSCACHE_OP_ST_CANCELLED; 217 op->state = FSCACHE_OP_ST_CANCELLED;
208 ret = -ENOBUFS; 218 ret = -ENOBUFS;
209 } 219 }
@@ -245,9 +255,11 @@ int fscache_submit_op(struct fscache_object *object,
245 flags = READ_ONCE(object->flags); 255 flags = READ_ONCE(object->flags);
246 if (unlikely(!(flags & BIT(FSCACHE_OBJECT_IS_LIVE)))) { 256 if (unlikely(!(flags & BIT(FSCACHE_OBJECT_IS_LIVE)))) {
247 fscache_stat(&fscache_n_op_rejected); 257 fscache_stat(&fscache_n_op_rejected);
258 op->cancel(op);
248 op->state = FSCACHE_OP_ST_CANCELLED; 259 op->state = FSCACHE_OP_ST_CANCELLED;
249 ret = -ENOBUFS; 260 ret = -ENOBUFS;
250 } else if (unlikely(fscache_cache_is_broken(object))) { 261 } else if (unlikely(fscache_cache_is_broken(object))) {
262 op->cancel(op);
251 op->state = FSCACHE_OP_ST_CANCELLED; 263 op->state = FSCACHE_OP_ST_CANCELLED;
252 ret = -EIO; 264 ret = -EIO;
253 } else if (flags & BIT(FSCACHE_OBJECT_IS_AVAILABLE)) { 265 } else if (flags & BIT(FSCACHE_OBJECT_IS_AVAILABLE)) {
@@ -276,11 +288,13 @@ int fscache_submit_op(struct fscache_object *object,
276 fscache_stat(&fscache_n_op_pend); 288 fscache_stat(&fscache_n_op_pend);
277 ret = 0; 289 ret = 0;
278 } else if (flags & BIT(FSCACHE_OBJECT_KILLED_BY_CACHE)) { 290 } else if (flags & BIT(FSCACHE_OBJECT_KILLED_BY_CACHE)) {
291 op->cancel(op);
279 op->state = FSCACHE_OP_ST_CANCELLED; 292 op->state = FSCACHE_OP_ST_CANCELLED;
280 ret = -ENOBUFS; 293 ret = -ENOBUFS;
281 } else { 294 } else {
282 fscache_report_unexpected_submission(object, op, ostate); 295 fscache_report_unexpected_submission(object, op, ostate);
283 ASSERT(!fscache_object_is_active(object)); 296 ASSERT(!fscache_object_is_active(object));
297 op->cancel(op);
284 op->state = FSCACHE_OP_ST_CANCELLED; 298 op->state = FSCACHE_OP_ST_CANCELLED;
285 ret = -ENOBUFS; 299 ret = -ENOBUFS;
286 } 300 }
@@ -335,7 +349,6 @@ void fscache_start_operations(struct fscache_object *object)
335 * cancel an operation that's pending on an object 349 * cancel an operation that's pending on an object
336 */ 350 */
337int fscache_cancel_op(struct fscache_operation *op, 351int fscache_cancel_op(struct fscache_operation *op,
338 void (*do_cancel)(struct fscache_operation *),
339 bool cancel_in_progress_op) 352 bool cancel_in_progress_op)
340{ 353{
341 struct fscache_object *object = op->object; 354 struct fscache_object *object = op->object;
@@ -355,9 +368,9 @@ int fscache_cancel_op(struct fscache_operation *op,
355 ASSERT(!list_empty(&op->pend_link)); 368 ASSERT(!list_empty(&op->pend_link));
356 list_del_init(&op->pend_link); 369 list_del_init(&op->pend_link);
357 put = true; 370 put = true;
371
358 fscache_stat(&fscache_n_op_cancelled); 372 fscache_stat(&fscache_n_op_cancelled);
359 if (do_cancel) 373 op->cancel(op);
360 do_cancel(op);
361 op->state = FSCACHE_OP_ST_CANCELLED; 374 op->state = FSCACHE_OP_ST_CANCELLED;
362 if (test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags)) 375 if (test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags))
363 object->n_exclusive--; 376 object->n_exclusive--;
@@ -373,8 +386,7 @@ int fscache_cancel_op(struct fscache_operation *op,
373 fscache_start_operations(object); 386 fscache_start_operations(object);
374 387
375 fscache_stat(&fscache_n_op_cancelled); 388 fscache_stat(&fscache_n_op_cancelled);
376 if (do_cancel) 389 op->cancel(op);
377 do_cancel(op);
378 op->state = FSCACHE_OP_ST_CANCELLED; 390 op->state = FSCACHE_OP_ST_CANCELLED;
379 if (test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags)) 391 if (test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags))
380 object->n_exclusive--; 392 object->n_exclusive--;
@@ -408,6 +420,7 @@ void fscache_cancel_all_ops(struct fscache_object *object)
408 list_del_init(&op->pend_link); 420 list_del_init(&op->pend_link);
409 421
410 ASSERTCMP(op->state, ==, FSCACHE_OP_ST_PENDING); 422 ASSERTCMP(op->state, ==, FSCACHE_OP_ST_PENDING);
423 op->cancel(op);
411 op->state = FSCACHE_OP_ST_CANCELLED; 424 op->state = FSCACHE_OP_ST_CANCELLED;
412 425
413 if (test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags)) 426 if (test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags))
@@ -440,8 +453,12 @@ void fscache_op_complete(struct fscache_operation *op, bool cancelled)
440 453
441 spin_lock(&object->lock); 454 spin_lock(&object->lock);
442 455
443 op->state = cancelled ? 456 if (!cancelled) {
444 FSCACHE_OP_ST_CANCELLED : FSCACHE_OP_ST_COMPLETE; 457 op->state = FSCACHE_OP_ST_COMPLETE;
458 } else {
459 op->cancel(op);
460 op->state = FSCACHE_OP_ST_CANCELLED;
461 }
445 462
446 if (test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags)) 463 if (test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags))
447 object->n_exclusive--; 464 object->n_exclusive--;
diff --git a/fs/fscache/page.c b/fs/fscache/page.c
index 7db9752252ef..d1b23a67c031 100644
--- a/fs/fscache/page.c
+++ b/fs/fscache/page.c
@@ -213,7 +213,7 @@ int __fscache_attr_changed(struct fscache_cookie *cookie)
213 return -ENOMEM; 213 return -ENOMEM;
214 } 214 }
215 215
216 fscache_operation_init(op, fscache_attr_changed_op, NULL); 216 fscache_operation_init(op, fscache_attr_changed_op, NULL, NULL);
217 op->flags = FSCACHE_OP_ASYNC | 217 op->flags = FSCACHE_OP_ASYNC |
218 (1 << FSCACHE_OP_EXCLUSIVE) | 218 (1 << FSCACHE_OP_EXCLUSIVE) |
219 (1 << FSCACHE_OP_UNUSE_COOKIE); 219 (1 << FSCACHE_OP_UNUSE_COOKIE);
@@ -249,6 +249,17 @@ nobufs:
249EXPORT_SYMBOL(__fscache_attr_changed); 249EXPORT_SYMBOL(__fscache_attr_changed);
250 250
251/* 251/*
252 * Handle cancellation of a pending retrieval op
253 */
254static void fscache_do_cancel_retrieval(struct fscache_operation *_op)
255{
256 struct fscache_retrieval *op =
257 container_of(_op, struct fscache_retrieval, op);
258
259 atomic_set(&op->n_pages, 0);
260}
261
262/*
252 * release a retrieval op reference 263 * release a retrieval op reference
253 */ 264 */
254static void fscache_release_retrieval_op(struct fscache_operation *_op) 265static void fscache_release_retrieval_op(struct fscache_operation *_op)
@@ -285,7 +296,9 @@ static struct fscache_retrieval *fscache_alloc_retrieval(
285 return NULL; 296 return NULL;
286 } 297 }
287 298
288 fscache_operation_init(&op->op, NULL, fscache_release_retrieval_op); 299 fscache_operation_init(&op->op, NULL,
300 fscache_do_cancel_retrieval,
301 fscache_release_retrieval_op);
289 op->op.flags = FSCACHE_OP_MYTHREAD | 302 op->op.flags = FSCACHE_OP_MYTHREAD |
290 (1UL << FSCACHE_OP_WAITING) | 303 (1UL << FSCACHE_OP_WAITING) |
291 (1UL << FSCACHE_OP_UNUSE_COOKIE); 304 (1UL << FSCACHE_OP_UNUSE_COOKIE);
@@ -330,24 +343,12 @@ int fscache_wait_for_deferred_lookup(struct fscache_cookie *cookie)
330} 343}
331 344
332/* 345/*
333 * Handle cancellation of a pending retrieval op
334 */
335static void fscache_do_cancel_retrieval(struct fscache_operation *_op)
336{
337 struct fscache_retrieval *op =
338 container_of(_op, struct fscache_retrieval, op);
339
340 atomic_set(&op->n_pages, 0);
341}
342
343/*
344 * wait for an object to become active (or dead) 346 * wait for an object to become active (or dead)
345 */ 347 */
346int fscache_wait_for_operation_activation(struct fscache_object *object, 348int fscache_wait_for_operation_activation(struct fscache_object *object,
347 struct fscache_operation *op, 349 struct fscache_operation *op,
348 atomic_t *stat_op_waits, 350 atomic_t *stat_op_waits,
349 atomic_t *stat_object_dead, 351 atomic_t *stat_object_dead)
350 void (*do_cancel)(struct fscache_operation *))
351{ 352{
352 int ret; 353 int ret;
353 354
@@ -359,7 +360,7 @@ int fscache_wait_for_operation_activation(struct fscache_object *object,
359 fscache_stat(stat_op_waits); 360 fscache_stat(stat_op_waits);
360 if (wait_on_bit(&op->flags, FSCACHE_OP_WAITING, 361 if (wait_on_bit(&op->flags, FSCACHE_OP_WAITING,
361 TASK_INTERRUPTIBLE) != 0) { 362 TASK_INTERRUPTIBLE) != 0) {
362 ret = fscache_cancel_op(op, do_cancel, false); 363 ret = fscache_cancel_op(op, false);
363 if (ret == 0) 364 if (ret == 0)
364 return -ERESTARTSYS; 365 return -ERESTARTSYS;
365 366
@@ -380,7 +381,7 @@ check_if_dead:
380 if (unlikely(fscache_object_is_dying(object) || 381 if (unlikely(fscache_object_is_dying(object) ||
381 fscache_cache_is_broken(object))) { 382 fscache_cache_is_broken(object))) {
382 enum fscache_operation_state state = op->state; 383 enum fscache_operation_state state = op->state;
383 fscache_cancel_op(op, do_cancel, true); 384 fscache_cancel_op(op, true);
384 if (stat_object_dead) 385 if (stat_object_dead)
385 fscache_stat(stat_object_dead); 386 fscache_stat(stat_object_dead);
386 _leave(" = -ENOBUFS [obj dead %d]", state); 387 _leave(" = -ENOBUFS [obj dead %d]", state);
@@ -464,8 +465,7 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie,
464 ret = fscache_wait_for_operation_activation( 465 ret = fscache_wait_for_operation_activation(
465 object, &op->op, 466 object, &op->op,
466 __fscache_stat(&fscache_n_retrieval_op_waits), 467 __fscache_stat(&fscache_n_retrieval_op_waits),
467 __fscache_stat(&fscache_n_retrievals_object_dead), 468 __fscache_stat(&fscache_n_retrievals_object_dead));
468 fscache_do_cancel_retrieval);
469 if (ret < 0) 469 if (ret < 0)
470 goto error; 470 goto error;
471 471
@@ -595,8 +595,7 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,
595 ret = fscache_wait_for_operation_activation( 595 ret = fscache_wait_for_operation_activation(
596 object, &op->op, 596 object, &op->op,
597 __fscache_stat(&fscache_n_retrieval_op_waits), 597 __fscache_stat(&fscache_n_retrieval_op_waits),
598 __fscache_stat(&fscache_n_retrievals_object_dead), 598 __fscache_stat(&fscache_n_retrievals_object_dead));
599 fscache_do_cancel_retrieval);
600 if (ret < 0) 599 if (ret < 0)
601 goto error; 600 goto error;
602 601
@@ -702,8 +701,7 @@ int __fscache_alloc_page(struct fscache_cookie *cookie,
702 ret = fscache_wait_for_operation_activation( 701 ret = fscache_wait_for_operation_activation(
703 object, &op->op, 702 object, &op->op,
704 __fscache_stat(&fscache_n_alloc_op_waits), 703 __fscache_stat(&fscache_n_alloc_op_waits),
705 __fscache_stat(&fscache_n_allocs_object_dead), 704 __fscache_stat(&fscache_n_allocs_object_dead));
706 fscache_do_cancel_retrieval);
707 if (ret < 0) 705 if (ret < 0)
708 goto error; 706 goto error;
709 707
@@ -946,7 +944,7 @@ int __fscache_write_page(struct fscache_cookie *cookie,
946 if (!op) 944 if (!op)
947 goto nomem; 945 goto nomem;
948 946
949 fscache_operation_init(&op->op, fscache_write_op, 947 fscache_operation_init(&op->op, fscache_write_op, NULL,
950 fscache_release_write_op); 948 fscache_release_write_op);
951 op->op.flags = FSCACHE_OP_ASYNC | 949 op->op.flags = FSCACHE_OP_ASYNC |
952 (1 << FSCACHE_OP_WAITING) | 950 (1 << FSCACHE_OP_WAITING) |