diff options
-rw-r--r-- | fs/fscache/object.c | 2 | ||||
-rw-r--r-- | fs/fscache/operation.c | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/fs/fscache/object.c b/fs/fscache/object.c index 12bb468bf0ae..9b79fc9a1464 100644 --- a/fs/fscache/object.c +++ b/fs/fscache/object.c | |||
@@ -610,6 +610,8 @@ static const struct fscache_state *fscache_lookup_failure(struct fscache_object | |||
610 | object->cache->ops->lookup_complete(object); | 610 | object->cache->ops->lookup_complete(object); |
611 | fscache_stat_d(&fscache_n_cop_lookup_complete); | 611 | fscache_stat_d(&fscache_n_cop_lookup_complete); |
612 | 612 | ||
613 | set_bit(FSCACHE_OBJECT_KILLED_BY_CACHE, &object->flags); | ||
614 | |||
613 | cookie = object->cookie; | 615 | cookie = object->cookie; |
614 | set_bit(FSCACHE_COOKIE_UNAVAILABLE, &cookie->flags); | 616 | set_bit(FSCACHE_COOKIE_UNAVAILABLE, &cookie->flags); |
615 | if (test_and_clear_bit(FSCACHE_COOKIE_LOOKING_UP, &cookie->flags)) | 617 | if (test_and_clear_bit(FSCACHE_COOKIE_LOOKING_UP, &cookie->flags)) |
diff --git a/fs/fscache/operation.c b/fs/fscache/operation.c index dec6defe3be3..18658fffbba1 100644 --- a/fs/fscache/operation.c +++ b/fs/fscache/operation.c | |||
@@ -176,6 +176,9 @@ int fscache_submit_exclusive_op(struct fscache_object *object, | |||
176 | list_add_tail(&op->pend_link, &object->pending_ops); | 176 | list_add_tail(&op->pend_link, &object->pending_ops); |
177 | fscache_stat(&fscache_n_op_pend); | 177 | fscache_stat(&fscache_n_op_pend); |
178 | ret = 0; | 178 | ret = 0; |
179 | } else if (flags & BIT(FSCACHE_OBJECT_KILLED_BY_CACHE)) { | ||
180 | op->state = FSCACHE_OP_ST_CANCELLED; | ||
181 | ret = -ENOBUFS; | ||
179 | } else { | 182 | } else { |
180 | fscache_report_unexpected_submission(object, op, ostate); | 183 | fscache_report_unexpected_submission(object, op, ostate); |
181 | op->state = FSCACHE_OP_ST_CANCELLED; | 184 | op->state = FSCACHE_OP_ST_CANCELLED; |
@@ -249,6 +252,9 @@ int fscache_submit_op(struct fscache_object *object, | |||
249 | list_add_tail(&op->pend_link, &object->pending_ops); | 252 | list_add_tail(&op->pend_link, &object->pending_ops); |
250 | fscache_stat(&fscache_n_op_pend); | 253 | fscache_stat(&fscache_n_op_pend); |
251 | ret = 0; | 254 | ret = 0; |
255 | } else if (flags & BIT(FSCACHE_OBJECT_KILLED_BY_CACHE)) { | ||
256 | op->state = FSCACHE_OP_ST_CANCELLED; | ||
257 | ret = -ENOBUFS; | ||
252 | } else { | 258 | } else { |
253 | fscache_report_unexpected_submission(object, op, ostate); | 259 | fscache_report_unexpected_submission(object, op, ostate); |
254 | ASSERT(!fscache_object_is_active(object)); | 260 | ASSERT(!fscache_object_is_active(object)); |